Conditional Formatting Trick 2 – How to get an icon in only some of the cells
2023-10-29 17:24:15
In my last post I described a way of adding icons to a range of cells using conditional formatting. This is a great way of providing visual feedback in your spreadsheet, but what if you only want to show the icon in certain cells?
The trick is to create a second conditional formatting rule that hides the icon in the cells where you don't want it to appear. To do this, select the range of cells that you want to apply the conditional formatting to, and then click on the "Conditional Formatting" button on the Home tab.
In the "New Formatting Rule" dialog box, select the "Use a formula to determine which cells to format" option, and then enter the following formula in the text box:
=AND(A1>5,A1<10)
This formula will return TRUE for any cells where the value in column A is greater than 5 and less than 10. All other cells will return FALSE.
Now, click on the "Format" button and select the "Icon Sets" tab. Choose the icon set that you want to use, and then select the icon that you want to display in the cells that meet the criteria in the formula.
Click on the "OK" button to close the "Format Cells" dialog box, and then click on the "OK" button again to close the "New Formatting Rule" dialog box.
The icon will now only appear in the cells that meet the criteria in the formula.