Condition within a range

NicNi

New Member
Joined
Jun 8, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm trying to write a formula to find if a column of results belong to one particular category. The results are shown underlined, cells filled in grey, red, or in black.

So far I've come up with this categories are
<A regular police, not underlined
A-B Underlined
B-C grey filled cell
C-D red filled cell
and <D black filled cell

=IF(Color=1,">D",IF(Color=3,"C-D",IF(Color=15,"B-C",IF(AND(Color=2,Underlined),"A-B","<A"))))

Color is =GET.CELL(63,OFFSET(INDIRECT("RC",FALSE),0,2,15))

and underlined is

=GET.CELL(22,OFFSET(INDIRECT("RC",FALSE),0,2,15))

I can't seem to be making it work for the cell range I'm looking for...

Any help is appreciated!
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Welcome to the Forum!

It looks like you're trying to test the colour / underline status of every cell in the column (height 15)?

Unfortunately, GET.CELL doesn't work that way. If you pass a range to GET.CELL, it looks only at the top left hand cell in that range.

You'll need to test each cell individually and aggregate the results, or switch to using a VBA function.
 
Upvote 0
Welcome to the Forum!

It looks like you're trying to test the colour / underline status of every cell in the column (height 15)?

Unfortunately, GET.CELL doesn't work that way. If you pass a range to GET.CELL, it looks only at the top left hand cell in that range.

You'll need to test each cell individually and aggregate the results, or switch to using a VBA function.
Aw shoot, I was trying to avoid using VBA.

Thank you for your answer though.
 
Upvote 0
In case the answer wasn't clear - you don't have to use VBA.

You can use GET.CELL from Excel, you just need to test cell by cell. You could do this in a helper column and hide that column, e.g. something like:

ABC
1Is range red?FALSEHIDE THIS
2
33
43
53
60
73
83
93
10
Sheet1
Cell Formulas
RangeFormula
B1B1=AND(C3:C9=3)
C3:C9C3=Color

Color: =GET.CELL(63,OFFSET(INDIRECT("RC",FALSE),,-1))

Note too that changing a cell's colour won't change the value of Color until the worksheet recalculates.
 
Upvote 0

Forum statistics

Threads
1,215,676
Messages
6,126,171
Members
449,296
Latest member
tinneytwin

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