Sometimes you need to filter cells with bold text in Excel.
But, in Excel, there is no direct way to do this. In this article, you will learn how to filter cells by bold characters in Excel.
Filter cells with bold font formatting using IsBold function
In the below image you can see in the product column some of the cells formatted bold.
If you apply filter and search option filter by bold then there is no such option.
I will solve this issue using the custom function or UDF named IsBold.
IsBold function returns True when a cell has bold format and False when the cell is not bold.
In the blank column write Isbold function (In the below pic E column).
Cell E2 formula =IsBold(C2)
In the above formula check whether cells of the product column have bold format or not.
In the below image you can see True is outputted for the product cell having bold text.
Now, apply the filter on table and filter True value from the IsBold column (column E).
In the below image you can see all the cells in the “C” column with bold format got filtered.
Attention:- This UDF formula will not re-calculate automatically if the cell format is changed after applying the formula.
Example – If you make cell C4 unbold then Isbold output will not change from True to False automatically, to update to correct output re-write the formula and copy-paste it over a range.
Creating IsBold UDF function in Excel
IsBold is not an inbuilt Excel function. You need to create this function using VBA.
To create this function press ALT+F11 to open VBA IDE.
In VBA IDE insert a new standard module.
In the newly created module copy paste the below code. Save as file either in Macro format (.xlsm) or in Binary format (.xlsb).
Function IsBold(rng As Range) As Boolean
IsBold = False
Dim cel As Range
For Each cel In rng
If cel.Font.Bold Then
IsBold = True
Exit Function
End If
Next
End Function
Filter row if one of the cell in range or row is bold
In the below image I need to filter rows with one or more bold cells.
The beauty of the IsBold function is that it outputs True if any one of the cells in the input range is formatted as bold.
Cell E2 function =IsBold(A2:D2)
Now, apply filter on table and filter True value.
You may also like to learn the below interesting topics
How to highlight alternate rows in Excel?
How to calculate percentage in Excel? ( Discount, GST, Margin, Change/growth, Markup)
How to Assign Serial Number to Duplicate or Unique Values In Excel?