Formula for Conditional formating

Nixson

New Member
Joined
Feb 11, 2018
Messages
18
Office Version
  1. 2016
Platform
  1. Windows
what is the formula, if the Current location Colum is Dubai then (No of Days) coloum should show green colour, if Other than Dubai Location and No of days is Morethan - 30 Days it need to show red colour & Less than - 30 should show yellow colour, what is formula for that,


Dewars Status16/03/2023
Serial No.WCCurrent locationDespatch Date/Received DateNo. of Days
4936100LTRDUBAI5-Oct-22-162
4937100LTRGHANA13-Mar-23-3
4938100LTRINDIA8-Dec-21-463
4939100LTRCHINA11-Dec-21-460
7557100LTRDUBAI17-Feb-22-392
7559100LTRDUBAI8-Dec-21-463
7561100LTRDUBAI19-Dec-22-87
7562100LTRDUBAI29-Apr-22-321
7563100LTRDUBAI5-Oct-22-162
7564100LTRDUBAI11-Dec-21-460
6219100LTRDUBAI15-Aug-21-578
7558100LTRDUBAI5-Aug-21-588
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
just to clarify

Rules

assuming A,B,C etc columns

confused
Green = column C = Dubai
But what in the days column ?

=AND( $C2 = "dubai", $E2 = ????

Or is that just if Dubai
then
=$C2 = "dubai"

RED
=AND( $C2 <> "dubai", $E2 > 30)

Yellow
=AND( $C2 <> "dubai", $E2 < 30)

what colour if actual 30 days

for 2007, 2010 , 2013 , 2016 , 2019 or 365 Subscription excel version
Conditional Formatting

Highlight applicable range >>
A2:E100 - Change, reduce or extend the rows to meet your data range of rows

Home Tab >> Styles >> Conditional Formatting
New Rule >> Use a formula to determine which cells to format
Edit the Rule Description: Format values where this formula is true:
=AND( $C2 <> "dubai", $E2 < 30)

Format [Number, Font, Border, Fill] YELLOW
choose the format you would like to apply when the condition is true
OK >> OK

repeat for other rules


in your example no days > then and not dubai


Book3
ABCDE
1Dewars Status3/16/23
2
3Serial No.WCCurrent locationDespatch Date/Received DateNo. of Days
4
54936100LTRDUBAI5-Oct-22-162
64937100LTRGHANA13-Mar-23-3
74938100LTRINDIA8-Dec-21-463
84939100LTRCHINA11-Dec-21-460
97557100LTRDUBAI17-Feb-22-392
107559100LTRDUBAI8-Dec-21-463
117561100LTRDUBAI19-Dec-22-87
127562100LTRDUBAI29-Apr-22-321
137563100LTRDUBAI5-Oct-22-162
147564100LTRDUBAI11-Dec-21-460
156219100LTRDUBAI15-Aug-21-578
167558100LTRDUBAI5-Aug-21-588
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E5:E16Expression=AND($C5<>"dubai", $E5<30)textNO
E5:E16Expression=AND( $C5 <> "dubai", $E5 > 30)textNO
E5:E16Expression=$C5="dubai"textNO
 
Last edited:
Upvote 0
See if this works

Book1
ABCDEFG
1Dewars Status16/03/2023
2
3Serial No.WCCurrent locationDespatch Date/Received DateNo. of Days
4
54936100LTRDUBAI10/5/2022-162
64937100LTRGHANA3/13/2023-3
74938100LTRINDIA12/8/2021-463
84939100LTRCHINA12/11/2021-460
97557100LTRDUBAI2/17/2022-392
107559100LTRDUBAI12/8/2021-463
117561100LTRDUBAI12/19/2022-87
127562100LTRDUBAI4/29/2022-321
137563100LTRDUBAI10/5/2022-162
147564100LTRDUBAI12/11/2021-460
156219100LTRDUBAI8/15/2021-578
167558100LTRDUBAI8/5/2021-588
17
Sheet7
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E5:E16Expression=AND(C5<>"Dubai",E5<-30)textNO
E5:E16Expression=AND(C5<>"Dubai",E5>-30)textNO
E5:E16Expression=C5="Dubai"textNO
 
Upvote 0

Forum statistics

Threads
1,214,786
Messages
6,121,553
Members
449,038
Latest member
Guest1337

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