among three cells, if one is formatted (bolded), yield a value to a fourth cell

keyshawn_irvin

New Member
Joined
Sep 16, 2014
Messages
2
I have a spreadsheet in which I have three cells, one of which is bolded, and I need the fourth column to yield a specific value based on which of the three cells is bolded.

More specifically, if the first of the three cells is bolded, I'd like the fourth cell to yield a value of '1'. If the second is bolded, the fourth would yield '2'. The third, yield '3'.

Thanks for any help the forum can offer.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
If you really only have three cells to check and if only one cell will be bold at any one time, then this should also work...
Code:
Function IsBold(Target As Range) As Long
  IsBold = -1 * Target(1).Font.Bold - 2 * Target(2).Font.Bold - 3 * Target(3).Font.Bold
End Function
 
Upvote 0
If you really only have three cells to check and if only one cell will be bold at any one time, then this should also work...
Code:
Function IsBold(Target As Range) As Long
  IsBold = -1 * Target(1).Font.Bold - 2 * Target(2).Font.Bold - 3 * Target(3).Font.Bold
End Function


I just wrote the additional loop in case anyone ever wants to expand the formula beyond the current scope. Who knows who will stumble upon this thread. The isbold function from the original thread got expanded to 3 from 1, so it could go up from here!
 
Upvote 0
I just wrote the additional loop in case anyone ever wants to expand the formula beyond the current scope. Who knows who will stumble upon this thread. The isbold function from the original thread got expanded to 3 from 1, so it could go up from here!

That is why I started off by saying "If you really only have three cells to check.." in order to limit its applicability to a small number of cells.
 
Upvote 0
NRS and Rick,

Thanks for your help - your advice worked brilliantly! So that you have some context, your time and advice has aided our project in which we are developing new and improved test items for students identified with significant cognitive disabilities. You have made a portion of my work much more efficient within a tight timeline.

Again, thank you for your assistance today!
--Keyshawn
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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