This solution employs a helper column (V), which may be hidden for aesthetic purposes.
The formula that populates the helper column is:
Formula:
=IFERROR(IF(ISNUMBER(MATCH(A4,'Store volume code'!B$2:B$16,0)),INDEX('Store volume code'!E$2:E$7,MATCH(C4,'Store volume code'!D$2:D$7,0)),IF(MATCH(A4,'Store volume code'!B$18:B$28,0),INDEX('Store volume code'!E$18:E$23,MATCH(C4,'Store volume code'!D$18:D$23,0)),"")),"")
The conditional formatting rule for column H is:
Formula:
=AND(H4<>"",V4<>"",H4<=V4)
Note: to get the conditional formatting to work I first chose the font color, on the fill tab I first selected the "No Color" button and then chose a color.
Let us know if you have any questions.
Bookmarks