Change cell-color based on value in another cell

Vod0

New Member
Joined
Mar 28, 2022
Messages
12
Office Version
  1. 365
Platform
  1. Windows
Hi. Am looking for a way to change the color of the cell based on a search on matching number and two letters in front of it. As of right now am matching the color with this code:
=IFERROR(AND(VALUE(RIGHT(A1,LEN(A1)-IFERROR(SEARCH("-",A1),0)))<=399,VALUE(RIGHT(A1,LEN(A1)-IFERROR(SEARCH("-",A1),0)))>=300),FALSE)

The two number on the top are always on row 1 and 2, and the cell I want to format is under and can be on row 10-80. Is there an easy way to do this? The reason for the long code is because am adding letters in front of the numbers below:

1655892743811.png


Its a flight schedule and for now this have been working great until now. The numbers are changing to much and suddenly a Red field is supposed to be blue, that's why am thinking it could be easier if its matching the color based on a match at the top field and if it contains "SK", "DY" etc.
Would this make the Excel-workbook to heavy or could it be done without compromising the size and speed?
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,215,008
Messages
6,122,672
Members
449,091
Latest member
peppernaut

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