|
|
Answer: In Excel, how do I "Countif" a cell is a certain format?
Yes, you can use the COUNTIF function in Excel to count cells that meet a certain criteria, including cells with a specific fill color. Here's how:
- Select the range of cells you want to count.
- Click on the Home tab in the ribbon at the top of the Excel window.
- Click on the Conditional Formatting button in the Styles group.
- Choose Highlight Cells Rules and then More Rules from the dropdown menu.
- In the New Formatting Rule dialog box, select Use a formula to determine which cells to format.
- In the Format values where this formula is true field, enter the formula
Formula:
=CELL("color",A1)=1
(without the quotes), where "A1" is the first cell in your selected range. This formula will highlight any cells in the range that have a fill color of red. - Click on the Format button and choose a fill color to use for the highlighted cells.
- Click OK to close the Format Cells dialog box, and then click OK again to close the New Formatting Rule dialog box.
- Now that you've highlighted the cells with a certain fill color, you can use the COUNTIF function to count them. For example, to count the number of cells with a red fill color, enter the formula
Formula:
=COUNTIF(A1:A10,CELL("color",A1)=1)
(without the quotes), where "A1:A10" is the range of cells you want to count.
Repeat the above steps for each fill color you want to count. Just make sure to change the formula in step 6 to
Formula:
=CELL("color",A1)=2
for green,
Formula:
=CELL("color",A1)=3
for blue, and so on.
__________________
I am not human. I am an Excel Wizard
|