In this tutorial, I am going to share with you step-by-step methods on how to use the COUNTIF function to count bold cells in excel. You can easily apply these steps in any set of data to count the existing bold cells. To achieve this task, we will also see some useful functions that might come in handy in many other excel related tasks. Also, in the last section, I will show you how we can count colored cells in excel.
Download Practice Workbook
You can download the practice workbook from here.
Step-by-Step Procedures to Use COUNTIF Function to Count Bold Cells in Excel
We have taken a concise dataset to explain the steps clearly. The dataset has approximately 7 rows and 2 columns. Initially, we are keeping all the cells in General format and the monetary values in Accounting format. For all the datasets, we have 2 unique columns which are Item and Price. Although we may vary the number of columns later on if that is needed.
Step 1: Opening Find & Select Option
- First, go to the Home tab and click on Find & Select under Editing.
- Here, click on Replace.
Step 2: Inserting Data
Now, we need to insert the data format that we count inside the Find and Replace window. Let us see how we can do this.
- Now, click on the Format drop-down beside the Find what option and select Choose Format From Cell.
- Then, click on any of the bold cells that you want to count.
- As a result, you will see a Preview of what to find and type bold in the Replace with option below.
- Now, click on Replace All.
Step 3: Applying the COUNTIF Function
In this final step, we will use the COUNTIF function to count the cells that have the word bold in them.
- After you completed the previous step, this will replace the bold cells with the text bold.
- Now, go cell C11 and type in the following formula:
- Finally, this will count the number of bold cells in the dataset.
- How to Use Excel COUNTIF Between Time Range (2 Examples)
- COUNTIF vs COUNTIFS in Excel (4 Examples)
- How to Use IF and COUNTIF Functions Together in Excel
- COUNTIF Excel Example (22 Examples)
How to Count Bold Cells Using VBA in Excel
If you are familiar with VBA in excel, then you can easily count if the cells contain bold formatting just by writing a few lines of code. Let us see how we can do that.
- For this method, go to the Developer tab and select Visual Basic.
- Now, select Insert in the VBA window and click on Module.
- Next, type in the formula below in the new window:
Function CountIfBold(SelectRange As Range) Dim CurrentRange As Range Dim BoldCount As Double For Each CurrentRange In SelectRange If CurrentRange.Font.Bold Then BoldCount = BoldCount + 1 End If Next CountIfBold = BoldCount End Function
- Then, go to cell C11 and insert this formula:
- Now, press the Enter key and this will calculate the number of bold cells inside cell C11.
How to Count Coloured Cells in Excel
We can use the COUNTIF function in excel to also count colored cells just as we did to count bold cells. Below are the detailed steps to do this.
- To begin with, navigate to the Home tab and click on Find & Select under Editing.
- Next, click on Replace.
- Now, in the Find and Replace window, click on Options.
- After that, click on the Format drop-down beside the Find what field and select Choose Format From Cell.
- Here, click on any of the cells with the fill color that you want to count.
- Consequently, you will see a preview in the window and type the word colored inside Replace with.
- Now, click on Replace All.
- As a result, this will insert the word colored in all the cells with fill color and here type this formula in cell C11:
- Finally, press Enter to get the number of cells with fill color.
I hope that you were able to apply the methods that I showed in this tutorial on how to count if cells contain bold formatting in excel. As you can see, there are quite a few ways to achieve this. So wisely choose the method that suits your situation best. If you get stuck in any of the steps, I recommend going through them a few times to clear up any confusion. Lastly, to learn more excel techniques, follow our ExcelDemy website. If you have any queries, please let me know in the comments.