Highlight times that are equal to or later than

alexfooty

Board Regular
Joined
Dec 30, 2018
Messages
97
Office Version
  1. 2016
Platform
  1. Windows
I will do my best to try to explain my problem.

In Col G I have a list of times (hh:mm) that vary each day and also the number of rows may vary.
In Col BG I have a list of dates with a corresponding time in Col BH.

Image 1.png

I would like to highlight any times in col G that are equal to, or later than, the time corresponding to today’s date in Col BH

In the following example, If today’s date was 05/11/2021, the corresponding time in Col BH would be 09:31. So any times equal to or later than that would be highlighted in Col G

Image 2.png


I hope someone understands this - any help would be greatly appreciated.
 

Attachments

  • Image 1.png
    Image 1.png
    6.7 KB · Views: 0

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
try
a conditional formatting rule of
Select G2:G1000 - or however many rows likely to be

=G2>=(INDEX($BG$2:$BG$1000,MATCH(TODAY(),$BH$2:$BH$1000,0)))

heres an example using different columns for ease and smaller - so you just adjust the rows to match your data

Book7
ABCD
1
27:3110/30/21
37:5010/31/21
48:0911/1/2111:00
58:2811/2/219:00
68:47
79:06
89:25
99:44
1010:03
1110:22
1210:41
1311:00
1411:19
1511:38
1611:57
1712:16
1812:35
1912:54
2013:13
2113:32
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A21Expression=A2>=(INDEX($D$2:$D$5,MATCH(TODAY(),$C$2:$C$5,0)))textNO
 
Upvote 0
Solution
Thanks etaf for your quick reply.
I used the conditional format formula you supplied but for some reason it isn't working.
Then I tried using the same setup as in your example - using Cols A,D & C and still not working.

Image 1.png


It's possibly some stupid mistake on my behalf but I can't spot anything.
 
Upvote 0
break it down in a other columns
its possible the times or dates are not real times or dates and just text
see what time just the index formula is returning

change the format of the cells to general and see if all the times and dates change to a number

not sure if xl2bb will show that
put column F I used
=INDEX($D$2:$D$5,MATCH(TODAY(),$C$2:$C$5,0))

dates are a number counting from 1900 , so 2nd Nov 2021 is the number 44502, and time is a decimal part of 1 so 12:00 is 0.5

Book7
ABCDEF
1INDEX
20.31319444444990.375
30.32638889445000.375
40.33958333445010.458333330.375
50.35277778445020.3750.375
60.365972220.375
70.379166670.375
80.392361110.375
90.405555560.375
100.418750.375
110.431944440.375
120.445138890.375
130.458333330.375
140.471527780.375
150.484722220.375
160.497916670.375
170.511111110.375
180.524305560.375
190.53750.375
200.550694440.375
210.563888890.375
220.375
Sheet1
Cell Formulas
RangeFormula
F2:F22F2=INDEX($D$2:$D$5,MATCH(TODAY(),$C$2:$C$5,0))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A21Expression=A2>=(INDEX($D$2:$D$5,MATCH(TODAY(),$C$2:$C$5,0)))textNO
 
Upvote 0
All the cells were correct format - times hh:mm, dates as dates.
Changed format to general and added the INDEX to Col F using formula.

Cols D & F did not change to a number but still showed as times (all cols format is general)

Image 2.png
 
Upvote 0
thats the issue column D is text and not a number / time , which is why its not working
column D needs to be time and change to a decimal of 1 like column A

you may be able to change the format of D by clicking on the column and DATA>text to columns >finish
 
Upvote 0
Now that works perfectly - (can't say I follow whats going on but it works)
Do I just change col A back to hh:mm as that is the format I require?
 
Upvote 0
yes, change the format as required
not sure which bit you are referring to as
(can't say I follow whats going on but it works)

The index/match

That is looking down the dates column and trying to match with a row where the date is today()
MATCH(TODAY(),$C$2:$C$5,0)
today() returns today's date and its looking down column C until it finds the row with the first matching date
then
INDEX($D$2:$D$5
is returning the same row but from the column D

Time is a fraction of 1 so you can treat it as a normal number

The index/match has returned the time , as i say which is decimal part of the number - so if 12:00 then 0.5 is returned by the index match

then A2 > = index
now its looking to see if a2 is greater than or equal to 0.5

With conditional formatting , think of it as a program that steps through each cell and checks if true or false

you have selected say A2 to A10
then added the formula
so conditional formatting will first check if A2 meets the criteria - TRUE/FALSE , if True then does whatever you format told it to do
IF you had STOP IF TRUE _ ticked in the conditional format then if it was TRUE , it would stop there
Then it checks A3 , A4, A5 etc and highlights all the cells that meet the criteria

Hope that helps a little
 
Upvote 0
Hi etaf
Spreadsheet now up and functioning perfectly and the Index/Match explanation was extremely useful.
Thank you so much for all your help and undoubted patience - it is greatly appreciated.
 
Upvote 0

Forum statistics

Threads
1,215,664
Messages
6,126,101
Members
449,292
Latest member
Mario BR

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