Conditional formatting with multiple criteria

ladygermain

New Member
Joined
Oct 8, 2021
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
Hi there,

First time poster here, any help someone can offer with my conditional formatting problem will go a long way!

I have a worksheet with worksites listed in the Column A and the days in a year listed across Row 1.

In a second worksheet I have the following data:
Column A: Worksite
Column B: Date site inspection began
Column C: Date site inspection ended

How can I construct a conditional formatting formula that will highlight cells in worksheet1 to show the days on which a worksite was being inspected based on the data in worksheet2?


Thanks in advance!
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi

please try this.
Sheet1:

Book1
ABCD
22Calender DatePlease Select the SiteW3
2330-Sep-21
2401-Oct-21
2502-Oct-21
2603-Oct-21
2704-Oct-21
2805-Oct-21
2906-Oct-21
3007-Oct-21
3108-Oct-21
3209-Oct-21
3310-Oct-21
3411-Oct-21
3512-Oct-21
3613-Oct-21
3714-Oct-21
3815-Oct-21
3916-Oct-21
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A23:A39Cell Valuebetween VLOOKUP($D$22,Sheet2!$K$1:$M$4,2,0) and VLOOKUP($D$22,Sheet2!$K$1:$M$4,3,0)textNO
Cells with Data Validation
CellAllowCriteria
D22List=Sheet2!$K$2:$K$4


Sheet2:

Book1
KLM
1WorksiteDate site inspection BeganDate site inspection ended
2W101-Oct-2102-Oct-21
3W204-Oct-2107-Oct-21
4W310-Oct-2111-Oct-21
Sheet2
 
Upvote 0
Hi May be this will be very use full and easy to get.

Book3
ABCDEFGHIJKLMNOPQRS
1Work SiteStart DateEnd Date30-Sep-2101-Oct-2102-Oct-2103-Oct-2104-Oct-2105-Oct-2106-Oct-2107-Oct-2108-Oct-2109-Oct-2110-Oct-2111-Oct-2112-Oct-2113-Oct-2114-Oct-2115-Oct-21
2W102-Oct-2103-Oct-21
3W204-Oct-2106-Oct-21
4W312-Oct-2113-Oct-21
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D5:I10,D2:S4Expression=AND(D$1>=$B2,D$1<=$C2)textNO
 
Upvote 0
hi

if your schedule is on weekend then the logic needs to change.

so based on that a new criteria has been added.

Book3
ABCDEFGHIJKLMNOPQRS
1Work SiteStart DateEnd Date30-Sep-2101-Oct-2102-Oct-2103-Oct-2104-Oct-2105-Oct-2106-Oct-2107-Oct-2108-Oct-2109-Oct-2110-Oct-2111-Oct-2112-Oct-2113-Oct-2114-Oct-2115-Oct-21
2W102-Oct-2103-Oct-21
3W203-Oct-2106-Oct-21
4W312-Oct-2113-Oct-21
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C2:C4Expression=OR(TEXT($C2,"DDD")="Sat",TEXT($C2,"DDD")="Sun")textNO
B2:B4Expression=OR(TEXT($B2,"DDD")="Sat",TEXT($B2,"DDD")="Sun")textNO
D2:S4Expression=OR(TEXT(D$1,"DDD")="Sat",TEXT(D$1,"DDD")="Sun")textYES
D2:S4Expression=AND(D$1>=$B2,D$1<=$C2)textNO
 
Upvote 0
Hi & welcome to MrExcel.
How can I construct a conditional formatting formula that will highlight cells in worksheet1 to show the days on which a worksite was being inspected based on the data in worksheet2?
Not sure you can do that with your version of Excel. I think that 2010 was the first version that allowed conditional formatting over different sheets.
 
Upvote 0
Hi & welcome to MrExcel.

Not sure you can do that with your version of Excel. I think that 2010 was the first version that allowed conditional formatting over different sheets.
I just doubled checked and it looks like I actually have the 2016 version - whoops!
 
Upvote 0
Hi May be this will be very use full and easy to get...
Thank you!

This has gotten me a lot closer but I'm running into an issue if I have more than one inspection listed for a worksite. The formatting will highlight the dates of the first inspection but won't also highlight any subsequent inspections for that worksite in the same row. Do you know how to fix this?
 
Upvote 0
Thank you!

This has gotten me a lot closer but I'm running into an issue if I have more than one inspection listed for a worksite. The formatting will highlight the dates of the first inspection but won't also highlight any subsequent inspections for that worksite in the same row. Do you know how to fix this?

hi may be this will help.

Book1
ABCDEFGHIJKLMNOPQRSTU
1Work SiteStart DateEnd DateSecond Start DateSecond End Date30-Sep-202101-Oct-202102-Oct-202103-Oct-202104-Oct-202105-Oct-202106-Oct-202107-Oct-202108-Oct-202109-Oct-202110-Oct-202111-Oct-202112-Oct-202113-Oct-202114-Oct-202115-Oct-2021
2W102-Oct-202103-Oct-20214-Oct-214-Oct-21
3W204-Oct-202106-Oct-2021
4W312-Oct-202113-Oct-2021
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
F2:U4Expression=AND(F$1>=$D2,F$1<=$E2)textNO
F2:U4Expression=AND(F$1>=$B2,F$1<=$C2)textNO
Cells with Data Validation
CellAllowCriteria
D2:D4Customand(B2<D4,C2>D4)
E2:E4Customand(B2<E4,C2>E4)


1633860823741.png
 
Upvote 0

Forum statistics

Threads
1,214,626
Messages
6,120,602
Members
448,974
Latest member
ChristineC

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