Conditional formatting based on two different values form two different cells

Hi all.
My goal is to apply conditional formatting on a specific cell based on the values in that cell and another cell.
Example: apply formatting to cell $E$2.

If value of D2 is <120 and value of cell E2 ,<80 then apply STYLE(“BP-Green”).

If value of D2 is between 120 – 129 and value of cell E2 <80 then apply STYLE(“BP-Yellow”).

If value of D2 is between 130 – 139 or value of cell E2 is between 80 – 89 the apply STYLE(“BP-Orange”).

If value of D2 between 140 - 179 or if value of cell E2 is =>90 apply STYLE(“BP-BurntOrange”).

If value of D2 is =>180 and/or value of cell E2 is =>120 apply STYLE(“Crisis”).

The following image may help. I want the cell background to correspond to the Image.

I am able to use the built in conditional formatting dialog for the first condition,see screen-shot below, but I don’t really know how to construct formula for the additional conditions.

I am assuming if this can be done it will be accomplished by using nested “IF” and “ElseIF” statement.
I have tried to begin the formula with “IF(AND but not getting desired result.

As I understand it Boolean expressions combined with AND only return the value True if both expressions evaluate to True:
True AND True returns True; for all other combinations the result is False.
My assumption is that the formula below would return False if cell E11 value was greater 80, but it seems that if if cell D11 is between 120 - 129 the formula returns True because the BP-Yellow style is applied.

I’ll make a suggestion


PKG; I would agree that your suggestion has accomplished exactly what I was trying. I am new to Calc and the associated formulas and functions. Now I will learn INDEX and MATCH so that I may understand how this was accomplished.

A second solution without the help table:

conditional formatting:


=1 Normal
=2 Elevated
=3 Stage 1
=4 Stage 2
=5 Crisis

Blood pressure.ods

Thank you for your response. I see that your solution works equally as well. I’ve already chosen the answer provided by PKG.