conditional formatting based on multiple criteria

Calvest1

New Member
Joined
Jul 24, 2024
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi Experts,

I have some data stored in a table (Data Table).

Data Table
DateStart TimeDurationEnd TimeTaskWorker
24/07/2024​
06:00​
120​
08:00​
Test descriptionWorker 1
25/07/2024​
07:00​
120​
09:00​
SleepWorker 2

I would like to apply conditional formatting based on Date, Start / end time and worker in the cells below (Range to colour) in the example data the x would be coloured.

Range to colour
24/07/2024​
06:00​
07:00​
08:00​
09:00​
10:00​
11:00​
12:00​
Worker 1XX
Worker 2XX

Please can you help with a formula for this?

Thank you in advance
 
Ah, I see. This complicates things. I suppose I could have figured there would be more than one entry per worker per day, even though your sample data did not show it. Alright, I will take a look and see if I can work it out.
thank you - and sorry :), i appreciate the help, i have been trying to do this for a week now and you have got further than i have.

Regards
 
Upvote 0

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
What is the maximum possible time periods can a worker have in a day? And are multiple rows per worker per day an option?
 
Upvote 0
What is the maximum possible time periods can a worker have in a day? And are multiple rows per worker per day an option?
It would be 8 hours per day, i have posted an image of the end result (note: i have got the text to work - just not the colour[colours do not need to be different])

do you mean multiple rows in the coloured area? - if so ideally not.

Thanks
 

Attachments

  • Screenshot 2024-07-25 183846.png
    Screenshot 2024-07-25 183846.png
    17.7 KB · Views: 3
Upvote 0
Okay, I thought as much, but I was hoping otherwise. At the moment then, this is all I have, as the logic to get it nice and concise and more user friendly is beyond my grasp.

It's a spill formula, so you would need enough rows per worker in the colored section per day, and it's not convenient enough to just drag down, so you would have to update it for the first instance of each worker per day. I do hope someone else watching can help further refine it or provide a better solution, but here it as anyway just in case. Also need to drag it across the columns per worker.

Book1 7-25-2024.xlsx
ABCDEFGHIJKLMNOP
1DateStart TimeDurationEnd TimeTaskWorker24/07/20246:007:008:009:0010:0011:0012:00
224/07/20246:001208:00Test descriptionWorker 1Worker 1XX     
325/07/20247:001209:00SleepWorker 2Worker 1X
424/07/202410:006011:00Test Item 2Worker 1Worker 2       
5
625/07/20246:007:008:009:0010:0011:0012:00
7Worker 1       
8Worker 2 XX    
Sheet1
Cell Formulas
RangeFormula
J2:P4J2=IFERROR(IF(BYROW(CHOOSECOLS(FILTER($B$2:$D$4,($A$2:$A$4=$I$1)*($F$2:$F$4=$I2),""),1,3),LAMBDA(r,AND(J$1>=CHOOSECOLS(r,1),K$1<=CHOOSECOLS(r,2),K$1<>""))),"X",""),"")
J7:P8J7=IFERROR(IF(BYROW(CHOOSECOLS(FILTER($B$2:$D$4,($A$2:$A$4=$I$6)*($F$2:$F$4=$I7),""),1,3),LAMBDA(r,AND(J$1>=CHOOSECOLS(r,1),K$1<=CHOOSECOLS(r,2),K$1<>""))),"X",""),"")
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
J7:P8Expression=J7="X"textNO
J2:P4Expression=J2="X"textNO
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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