Match Function for Time of Day

warpedone

Board Regular
Joined
May 1, 2002
Messages
139
I have about 40 pages of data - each containing a table with the date and time of day (in even numbered, military hours).

There is a corresponding cell on the main page for each data page. The user selects a time (cell C1) and date (cell A1) and each cell returns a value from it's respective data page.

I'm having trouble with the Time of Day. Here's my whole equation:

=INDEX(y01data,MATCH($C$1,'008Y01'!$B$5:$B$28,1),MATCH(VALUE($A$1),'008Y01'!$C$1:$AO$1,0))

The Time of Day match is where it's messed up:
MATCH($C$1,'008Y01'!$B$5:$B$28,1)
I have to use "1" as my match type because "0" returns a #N/A
In using "1", when I select a different time of day, it sometimes won't switch rows (when I switch from 1:00 to 2:00 or 16:00 to 17:00 nothing happens).

I think the Match function with the 1 as the match type is thinking that the row above the one I'm wanting is close enough and not going to the correct row.

Any ideas?
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
OK...since time is represented as a decimal and 16 of my numbers don't end (.xxx33333333 repeating or .xxx666666 repeating) - I'm pretty sure that's why I can't use a match type of "1"

Any idea how I limit the number of decimal places (not only what I can see but also what excel uses to calculate)?
 
Upvote 0
Here's what I wound up using that worked:

User selects dropdown date in A1 and dropdown time in C1
In AC1, I put the equation =C1*100

I then used the equation =INDEX(y01data,MATCH(VALUE($AC$1)+1,'008Y01'!$B$5:$B$28,1),MATCH(VALUE($A$1),'008011'!$C$1:$AO$1,0)+2)

For the time on sheet 008Y01 (column B), I used 0 for 0:00; 4.17 for 1:00; 8.33 for 2:00; etc. up to 95.833 for 23:00 (looks like it's 24 hours spread out over a range of 100).
Date runs across row 1 of 008Y01 from C1 to AO1 (that worked fine without having to manipulate it)

Been a long time and not sure why it works without looking at it a little harder, but, there it is.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,831
Members
452,947
Latest member
Gerry_F

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