I am trying to use the Match function to return the row of an indicated table that a certain time value is on. The time is in mm:ss format on the table, so I want users to input the desired time to match as text for their simplicity (with data validation to ensure its correct format), and then use the Time function within the Match function to convert the input to match the format of the table for comparison. However, when using the Time function, the Match function returns the incorrect row, one row number short of what it should be to be precise. I attempted to do some debugging (shown below) and looked into the documentation of both the Time and Match functions, but can't figure out why this would happen. Is there something about the Time function I'm missing?
Here is a breakdown of what I'm using and what I've done to debug and figure out it's the Time function that's causing me issues. Column B has the functions I've been using and their results, and Column C has direct links to the table to show what the output should be. Column D shows that the time values are exactly the same but that using them yields different results in the Match function. Column E is the user input time in text format, and the lookup array is in column G.
Here is a breakdown of what I'm using and what I've done to debug and figure out it's the Time function that's causing me issues. Column B has the functions I've been using and their results, and Column C has direct links to the table to show what the output should be. Column D shows that the time values are exactly the same but that using them yields different results in the Match function. Column E is the user input time in text format, and the lookup array is in column G.
Time Function Problem.xlsx | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
1 | Calculated | Expected | Calculated = Expected | Entered Time | Lookup Array | ||||
2 | Time Equation | =TIME(0,LEFT($E$2,2),RIGHT($E$2,2)) | =Sheet1!G11 | 01:23 | 00:00 | ||||
3 | Time | 12:01:23 AM | 12:01:23 AM | TRUE | |||||
4 | Time Value | 0.00096064814814814800000 | 0.00096064814814814800000 | TRUE | 01:17 | ||||
5 | Match Result | 9 | 10 | FALSE | |||||
6 | Match Equation | =MATCH(B3,G2:G19,1) | =MATCH(C3,G2:G19,1) | 01:18 | |||||
7 | |||||||||
8 | 01:19 | ||||||||
9 | |||||||||
10 | 01:20 | ||||||||
11 | 01:23 | ||||||||
12 | 01:26 | ||||||||
13 | 01:30 | ||||||||
14 | 01:33 | ||||||||
15 | 01:36 | ||||||||
16 | 01:39 | ||||||||
17 | 01:43 | ||||||||
18 | 01:46 | ||||||||
19 | 01:49 | ||||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B3 | B3 | =TIME(0,LEFT($E$2,2),RIGHT($E$2,2)) |
C3 | C3 | =Sheet1!G11 |
D3:D5 | D3 | =B3=C3 |
B4:C4 | B4 | =B3 |
B5 | B5 | =MATCH(B3,G2:G19,1) |
C5 | C5 | =MATCH(C3,G2:G19,1) |
Cells with Data Validation | ||
---|---|---|
Cell | Allow | Criteria |
B2 | Text length | =5 |
E2 | Text length | =5 |