If statement where bold text is the key

bayoung

Board Regular
Joined
May 3, 2004
Messages
94
Is it possible to create an "If" statement where if a cell contains bold text, the answer is 1, and if not, the answer is 0?
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
The short answer is yes.

The long answer is, yes but it depends on how your cells got bolded.

If the bold format is due to the cell's font property being set to "Bold" (such as when you click on Format > Cells > Font Tab) then

You will need a user defined function in VBA to construct a formula to identify the bold property.

Otherwise if the font is bold due to conditional formatting then

you can get by with a formula that tests for the same condition in the subject cell as does the conditional formatting.


So, clarify what you really have and someone can assist with a formula that is appropriate for your situation.
 
Upvote 0
You will have to do a Recalc (F9) if you change the bolding for it to update after changes, but perhaps:

Code:
Public Function isbold(r As Range) As Integer
Application.Volatile
isbold = Abs(r.Font.Bold = True)
End Function
 
Upvote 0

Forum statistics

Threads
1,221,572
Messages
6,160,575
Members
451,656
Latest member
SBulinski1975

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top