How to Use the COUNTIF Function in Excel to Count Bold Cells

Dataset Overview

Let’s assume we have a concise dataset with approximately 7 rows and 2 columns. Initially, all cells are in the General format, and monetary values are in Accounting format. The dataset contains two unique columns: Item and Price. If needed, we can adjust the number of columns later.

excel countif bold


Step 1 – Opening Find & Select Option

  • Go to the Home tab.
  • Click on Find & Select under the Editing section.
  • Choose 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

  • In the Find and Replace window, click the Format drop-down next to the Find what option.
  • Select Choose Format From Cell.

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

  • Click on any bold cell that you want to count.

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

  • You’ll see a preview of what to find; enter bold in the Replace with field.
  • Click Replace All.


Step 3 – Applying the COUNTIF Function

  • After completing the previous step, the bold cells will be replaced with the text bold.
  • Go to cell C11.
  • Type the following formula:

=COUNTIF(C5:C10,"bold")

  • Press Enter to calculate 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

  • Go to the Developer tab.
  • Select Visual Basic.

vba code to count if cells contain bold formatting in excel

  • Click Insert in the VBA window and choose Module.

vba code to count if cells contain bold formatting in excel

  • Enter the following formula 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

  • In cell C11, insert this formula:
=CountIfBold(C5:C10)

  • Press Enter to calculate the number of bold cells.

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


Counting Colored Cells in Excel

  • Navigate to the Home tab.
  • Click on Find & Select under Editing.
  • Choose Replace.

  • In the Find and Replace window, click Options.

  • Click the Format drop-down next to the Find what field and select Choose Format From Cell.

  • Click on any of the cells with the fill color that you want to count.

  • Enter the word colored in the Replace with field.
  • Click Replace All.

  • In cell C11, use this formula:
=COUNTIF(C5:C10,"colored")

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


 

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