How to Use COUNTIF Function In Excel to Count Bold Cells

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.


How to Use COUNTIF Function In Excel to Count Bold Cells

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.

excel countif bold


Step 1: Opening Find & Select Option

In the following section, we will see how to open the Find & Select option to count bold cells in Excel using the COUNTIF function. Follow the steps below to achieve this.

  • First, go to the Home tab and click on Find & Select under Editing.
  • Here, click on Replace.

find & select option to count if cells contain bold formatting in excel

Read More: Count Text at Start with COUNTIF & LEFT Functions in Excel


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.

find & select option to count if cells contain bold formatting in excel

  • Then, click on any of the bold cells that you want to count.

find & select option to count if cells contain bold formatting in excel

  • 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.

Read More: [Fixed!] Excel COUNTIF Function Not Working for String “True”


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:
=COUNTIF(C5:C10,"bold")

  • Finally, this will count the number of bold cells in the dataset.

Read More: [Fixed] COUNTIF Function with Wildcard Not Working in Excel


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.

Steps:

  • For this method, go to the Developer tab and select Visual Basic.

vba code to count if cells contain bold formatting in excel

  • Now, select Insert in the VBA window and click on Module.

vba code to count if cells contain bold formatting in excel

  • 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:
=CountIfBold(C5:C10)

  • Now, press the Enter key and this will calculate the number of bold cells inside cell C11.

Read More: [Solved!]: Excel COUNTIF Returning 0 Instead of Actual Value


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.

Steps:

  • 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:
=COUNTIF(C5:C10,"colored")

  • Finally, press Enter to get the number of cells with fill color.

Read More: How to Use COUNTIF Function to Count Text from List in Excel


Download Practice Workbook

You can download the practice workbook from here.


Conclusion

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 on any of the steps, I recommend going through them a few times to clear up any confusion. If you have any questions, please let me know in the comments.


Related Articles


<< Go Back to Excel COUNTIF Function | Excel Functions | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Nazmul Hossain Shovon
Nazmul Hossain Shovon

Nazmul Hossain Shovon, a BUET graduate in Naval Architecture and Marine Engineering, embarked on his career with 8 months dedicated to the Exceldemy project's triumph. Transitioning into a Software Developer role, he specialized in web add-in development. At Exceldemy, he authored about 125 blog articles and solved many visitors’ problems, refining his writing skills and delving into Excel-related topics. With a primary passion for programming and software development, Shovon continually explores new horizons, fostering professional growth in his... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo