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.
 

Some videos you may like

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,675
Office Version
  1. 2010
Platform
  1. Windows
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
 

NeonRedSharpie

Well-known Member
Joined
Jul 14, 2014
Messages
1,678
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!
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,675
Office Version
  1. 2010
Platform
  1. Windows
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.
 

keyshawn_irvin

New Member
Joined
Sep 16, 2014
Messages
2
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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,233
Messages
5,594,963
Members
413,954
Latest member
mrsandy

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