x

How to Use If-Then Excel Equations to Color Cells

by C. TaylorUpdated September 28, 2017

You may already be familiar with Excel's IF function, which allows you to perform calculations based on certain criteria. You can use a similar if-then function to color the cells in Excel. This feature is found in "conditional formatting." Although this feature does not necessitate entering the function IF, the function is identical. As an example, you could tell your computer "if the calculated number is negative, then color the cell red."

Highlight the cells that you want to apply conditional formatting to. You can do this by clicking and dragging your mouse across the cells.

Click the "Home" tab.

Click "Conditional Formating" in the "Styles" group, point to "Highlight Cells Rules" then click "More Rules."

Enter the criteria in the "Edit only cells with" section. To configure the previously cited example, select "Cell Value" in the first drop-down menu, "less than" in the second drop-down menu, and type "0" in the last field. This reads "if the value in the selected cells are less than 0, then."

Click "Format" in the bottom section.

Click the "Fill" tab in the "Format Cells" window.

Click the color you want to use from the palate, then click "OK."

Click "OK" in the "New Formatting Rule" window to apply the conditional formatting. Any cells that meet your criteria will be colored.

Video of the Day

Brought to you by Techwalla
Brought to you by Techwalla

More Articles