If statement on format

eyeldham

New Member
Joined
Jan 2, 2003
Messages
49
Can an if statement evaluate the format of a cell?

Could it return one result if the cell is highlighted in bold (or a colour) whilst returning another if it is unformatted?

Used if statements a lot but this would be a help if it could achieve this.

Ed
 

Some videos you may like

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

JamesW

Well-known Member
Joined
Oct 30, 2009
Messages
1,197
Hi Ed,

You can do this with VBA, but not with excel functions (unless you create a UDF of course).

Code:
Function isBold(myCell As Range) As Variant
    Select Case myCell.Font.Bold
        Case True
            isBold = True
        Case False
            isBold = False
    End Select
End Function

=isBold(A1)

Note, this will only work for one cell at a time.
 

Expiry

Well-known Member
Joined
Jun 20, 2007
Messages
865
If you're using conditional formatting, you can use the same conditions to get the result you want.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,259
Messages
5,600,575
Members
414,390
Latest member
plimbu

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
Top