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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,224,825
Messages
6,181,191
Members
453,021
Latest member
pingpong7117

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