Conditional Formatting or probably a Gant Chart

Heysweden

New Member
Joined
Nov 10, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hi, I'm currently making a excel template on which I will manually enter Start Time and End time.

After inputting start time and end time in should color the cells between the start and end time.

I need it in a 24 hour format, were when I tried if start time is less than end time, then it is working perfectly, but if end time is greater than start time it is not highlighting the cells.

For e.g My start time is 15:00 at the evening and end time is at 2 at early morning next day, then it should highlight the cells from 15 of the current day to the next day till 2.

I would appreciate your help on how to fix this.

1699610764140.png
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
The values in column A and B should be dates, but format only the time component, Row 3 should also be treated the same way.
(the formulas in the cells are what I used to confirm the conditional formatting rule, they do not need to be in your worksheet).

Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZ
1
2StartEndHoursDate00:0001:0002:0003:0004:0005:0006:0007:0008:0009:0010:0011:0012:0013:0014:0015:0016:0017:0018:0019:0020:0021:0022:0023:0000:0001:0002:0003:0004:0005:0006:0007:0008:0009:0010:0011:0012:0013:0014:0015:0016:0017:0018:0019:0020:0021:0022:0023:00
300:0023:0023:00TRUETRUETRUETRUETRUETRUETRUETRUETRUETRUETRUETRUETRUETRUETRUETRUETRUETRUETRUETRUETRUETRUETRUEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSE
415:0002:0011:00FALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSETRUETRUETRUETRUETRUETRUETRUETRUETRUETRUETRUEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSE
519:0023:0004:00FALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSETRUETRUETRUETRUEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSE
603:0004:0001:00FALSEFALSEFALSETRUEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSE
708:0011:0003:00FALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSETRUETRUETRUEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSE
Sheet1
Cell Formulas
RangeFormula
E2:AZ2E2=DATE(2023,11,10) + SEQUENCE(1,48,0,1)/24
E3:AZ7E3=AND($A3<=E$2,$B3>E$2)
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E3:AZ7Expression=AND($A3<=E$2,$B3>E$2)textNO
 
Upvote 1
Hi, many thanks for your support, you were like an angel to me, because I was stuck and unsure on how I would solve this since I also a newbie in excel. Coming to the point I tried your method and it worked perfectly fine, but I just want to check with you by giving an example. I have a vehicle that is coming to a parking location, so when the vehicle arrives that will be my start time and when the vehicle leaves it will be end time. I'm creating a schedule for a week were I will mark the days and time when the vehicle is at the parking space. For e,g if the vehicle reaches on 12th Nov from morning 8 to evening 16, I will highlight the cells on that duration, but on the same row I should highlight the cells when the vehicle coming back on the next day ie 13th Nov may be at evening 15 till midnight 22(were the duration of both the days should highlight), so it will be like one vehicle on different days with different duration on a same row. Sorry for the long explanation, as an input I can have both date and time. Thanks in advance.

1699811667290.png
 
Upvote 0
Okay, so to summarize your question: You're asking for what if two different time groups are used for the same row?

I'm thinking you need to record a second seven sets of time start/duration. Or you'll have to repeat the same row for that parking location.

Or you can have another way of looking at/processing your scenario. One section of your worksheet/workbook to record the
Space Number, Start Time, Duration. and then use that to fill in your gannt chart with different calculations.
 
Upvote 1
Okay, so to summarize your question: You're asking for what if two different time groups are used for the same row?

I'm thinking you need to record a second seven sets of time start/duration. Or you'll have to repeat the same row for that parking location.

Or you can have another way of looking at/processing your scenario. One section of your worksheet/workbook to record the
Space Number, Start Time, Duration. and then use that to fill in your gannt chart with different calculations.
Yes, I have two different time groups for the same row, that means if I select a date and time, then it should highlight cells for that particular date and duration, on the same row if I change to another date and time, then both should highlight.
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,885
Members
452,364
Latest member
springate

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