Você está na página 1de 5

A simple Excel conditional format

technique that highlights input cells


Takeaway: Use this simple conditional format technique for Excel to solicit input
values from users.
Conditional formats highlight data to alert users to specific conditions. Its a flexible
and powerful tool, and it is sometimes overlooked if the need seems too simple. For
instance, youll often see sheets with shaded input cells. Its an easy way to visually
tell users that they need to enter data. Often, the sheets author just applies a normal
shading format, which means the shading never disappears. It remains even after the
user inputs the obligatory data. Thats not wrong; its just a bit inconsistent.
Using a conditional format, you can easily remove the shading once the user enters a
value. Doing so might alleviate any possible confusion the user might sense when the
shading remains. Now, lets look at a simple example using the simple sheet below.
The formula in B3 will return the number of records that occur between the beginning
and ending dates:
=COUNTIFS(A5:A12,">="&B1,A5:A12,"<="&B2)

This sheets purpose isnt particularly important, but it does have two input cells: B1
and B2. You can apply conditional shading to these two cells as follows:
1. Select B1:B2.
2. Click the Home tab. Click Conditional Formatting in the Styles group, and
choose New Rule. In Excel 2003, choose Conditional Formatting from the
Format menu.
3. From the Select A Rule Type list, choose the Use A Formula To Determine
Which Cells To Format option. In Excel 2003, choose Formula Is from the
condition dropdown.
4. Enter the following formula
=ISBLANK(B1)
5. Click the Format button.
6. Click the Fill tab (if necessary), select a color, and click OK. The dialog will
display the formula and the fill color. In Excel 2003, click the Patterns tab.

7. Click OK to return to the sheet. Cells B1 and B2 will display the fill color you
chose in step 7.

The ISBLANK() function returns true while either cell remains empty.
Now, you couldve done the same thing using the Fill Color option, bypassing the
ISBLANK() function and saving yourself a few steps, right? Not really. Enter a date
into B1 and see what happens. As soon as you press Enter or Tab, the conditional
format formula (the ISBLANK() function) is no longer true, so Excel removes the
conditional format - a subtle clue to the user that he or she has completed the task
successfully.

At this point, you might be wondering if the result is worth the work. When youre
creating a workbook for someone else, the answer is usually yes. Its a small addition,
but it does have meaning for the user.

Você também pode gostar