In column L, I have a mathematical formula that displays scores from prior cells. Based on the score in column L, I have conditional formatting setup so it shades those values with any of 4 colors.

(255,0,0), (255,255,0), (146,208,80) & (0,176,80).

That works fine. However, in the adjacent M cells, I would like to have a quartile value displayed based on the color of the L cell next to it. Since the L cell is shaded only with C.F., the column M formula (below) appears to be recognizing the color in the L cells as uncolored.

My quartiles are setup as follows:

(255,0,0) = 4

(255,255,0) = 3

(146,208,80) = 2

(0,176,80) = 1

1) Can I have the M cell formula "see" the C.F. color and make it's determination based off of that without having to manually shade the adjacent cell?

2) Do I have the color codes in the formula below correct based on the RGB values listed above?

I have the formula below. If I enter =MyColor(L3) into M3, it displays a 0. I am guessing due to it seeing a non-colored cell in L3.

Function MyColor(myRange As Range) As Long

Dim myValue As Long

Select Case myRange.Interior.Color

'Red

Case 255

myValue = 4

'Yellow

Case 2552550

myValue = 3

'LtGrn

Case 14620880

myValue = 2

'DkGrn

Case 17680

myValue = 1

End Select

MyColor = myValue

End Function