Switch cell with color based on 3 different conditions

amaresh achar

Board Regular
Joined
Dec 9, 2016
Messages
108
Office Version
  1. 365
Platform
  1. Windows
Hi..

I need help with conditional formatting using formula:

I have the following values in my sheet:

E18: 287.2
F18: 289.2

If J18 is blank, then NO FILL ;
If J18 cell value is between cell values of E18 and F18, then fill J18 cell with LIGHT GREEN background color and DARK GREEN Text color
else fill J18 cell with LIGHT RED background color and DARK RED Text color

Thanks in advance.
 
When I first looked at the image of you data sample, it looked like the cells in columns E and F were merged cells. Turns out they weren't. That meant that the CF formulas had to be different in the even and odd numbered rows.
As such, the file I shared with you, with all the correct CF formulas inserted, had each odd numbered row referring to the same row in columns E and F - whereas the formulas in the even numbered rows had to refer to columns E and F one row ABOVE.
This means that you cannot simply extend the scope of the CF by merely increasing the Apply to range, because they subsequent formulas would only be correct 50% of the time. You need to get 2 rows correct (an odd and even row) and then copy the format from BOTH rows to subsequent rows in pairs.
This is what I did in the last file I shared with you - tedious process but only has to be done once.
I'm willing to help you again. If you share the latest incarnation of your file, I will put the CF in for you. However, given that you have previously "finalised" this thread twice already, it will be last time I will respond to requests for further "tweaks", and any further changes you make I can only suggest that you start a new thread. It's after midnight in my part of the world, so it'll be a job for tomorrow.
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
When I first looked at the image of you data sample, it looked like the cells in columns E and F were merged cells. Turns out they weren't. That meant that the CF formulas had to be different in the even and odd numbered rows.
As such, the file I shared with you, with all the correct CF formulas inserted, had each odd numbered row referring to the same row in columns E and F - whereas the formulas in the even numbered rows had to refer to columns E and F one row ABOVE.
This means that you cannot simply extend the scope of the CF by merely increasing the Apply to range, because they subsequent formulas would only be correct 50% of the time. You need to get 2 rows correct (an odd and even row) and then copy the format from BOTH rows to subsequent rows in pairs.
This is what I did in the last file I shared with you - tedious process but only has to be done once.
I'm willing to help you again. If you share the latest incarnation of your file, I will put the CF in for you. However, given that you have previously "finalised" this thread twice already, it will be last time I will respond to requests for further "tweaks", and any further changes you make I can only suggest that you start a new thread. It's after midnight in my part of the world, so it'll be a job for tomorrow.
Oh.. I am extremely sorry Sir... I didnt know its such a tedious task... Now I know what needs to be done... I'll try doing as you explained.... And thank you so much for the help Sir...
 
Upvote 0
Oh.. I am extremely sorry Sir... I didnt know its such a tedious task... Now I know what needs to be done... I'll try doing as you explained.... And thank you so much for the help Sir...
If you run into problems, let me know and share the file. And note that you can copy as many rows (to grab the formats) as you like - as long as it's an even number, 2 or 200...
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

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