Conditional Format - Highlight Cell if Not Sunday

SaraWitch

Board Regular
Joined
Sep 29, 2015
Messages
153
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Hello peeps.

I have Column R formatted to ddd, dd/dd/dddd. If the date entered is not a Sunday, I want to highlight it red. I have tried CFs:
=ISERROR(FIND("Sun*",$R3)) (Fill red)

And:
Condition 1: =ISBLANK($R3)=TRUE (No format Set)
Condition 2: = ISNUMBER(SEARCH("Sun*",$R3))=FALSE (Fill red)

Both are highlighting all the cells (which are either blank or have a Sunday date (e.g., Sun, 27/06/2021)).

Any help would be appreciated...

Ta muchly!
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

SaraWitch

Board Regular
Joined
Sep 29, 2015
Messages
153
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
That's grand; thank you, @BenMcBen! And how do I not highlight if blank cell*?

*Don't worry, I figured it out by adding another CF:
ISBLANK($R3) ...then ticking 'Stop If True'.

Thank you for your speedy fix, @BenMcBen! :)
 
Last edited:
Upvote 0

BenMcBen

New Member
Joined
Aug 19, 2014
Messages
34
Use the "AND()" function to add an extra check - eg (several ways you could skin this cat):

Excel Formula:
=and(text(yourcell,"DDD")<>"Sun",NOT(ISBLANK(yourcell)))

There's a lot of variations to the exact formula you could use above (e.g. using the WEEKDAY() function), you could also use separate CF rules with stops etc...
 
Upvote 0

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
83,352
Office Version
  1. 365
Platform
  1. Windows
No need to add another rule, you can use
Excel Formula:
=and(text($R3,"ddd")<>"Sun",$R3<>"")
 
Upvote 0

SaraWitch

Board Regular
Joined
Sep 29, 2015
Messages
153
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Perfect; thanks, both.

I've actually ended up using data validation to not allow dates other than a Sunday!

This is all useful to my Excel knowledge though and I can use this elsewhere, so thank you!

HNY! ?
 
Upvote 0

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
83,352
Office Version
  1. 365
Platform
  1. Windows
Glad we could help & thanks for the feedback.
 
Upvote 0

SaraWitch

Board Regular
Joined
Sep 29, 2015
Messages
153
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Sorry, guys; I have another element I need to add!

If I want this to apply only if "EBC" or "LDC" in Column E, how would this look?
 
Upvote 0

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
83,352
Office Version
  1. 365
Platform
  1. Windows
How about
Excel Formula:
=AND(TEXT($R3,"ddd")<>"Sun",$R3<>"",OR($E3="EBC",$E3="LDC"))
 
Upvote 0

Forum statistics

Threads
1,191,576
Messages
5,987,390
Members
440,095
Latest member
yanaungmyint

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
Top