Error in Excel with Time function within Match function

Dlark

New Member
Joined
Dec 27, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
  3. Mobile
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.

Time Function Problem.xlsx
ABCDEFG
1CalculatedExpectedCalculated = ExpectedEntered TimeLookup Array
2Time Equation=TIME(0,LEFT($E$2,2),RIGHT($E$2,2))=Sheet1!G1101:2300:00
3Time12:01:23 AM12:01:23 AMTRUE
4Time Value0.000960648148148148000000.00096064814814814800000TRUE01:17
5Match Result910FALSE
6Match Equation=MATCH(B3,G2:G19,1)=MATCH(C3,G2:G19,1)01:18
7
801:19
9
1001:20
1101:23
1201:26
1301:30
1401:33
1501:36
1601:39
1701:43
1801:46
1901:49
Sheet1
Cell Formulas
RangeFormula
B3B3=TIME(0,LEFT($E$2,2),RIGHT($E$2,2))
C3C3=Sheet1!G11
D3:D5D3=B3=C3
B4:C4B4=B3
B5B5=MATCH(B3,G2:G19,1)
C5C5=MATCH(C3,G2:G19,1)
Cells with Data Validation
CellAllowCriteria
B2Text length=5
E2Text length=5
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
You have MATCH(B3,G2:G19,1) as formula, so it will return the position in the range G2:G19. And 9 is correct. That's the value in 10th row, but it is the 9th row in the given range.
If you want the row number, either change the range toG1:F19 or add 1 to the formula used.
 
Upvote 0
You have MATCH(B3,G2:G19,1) as formula, so it will return the position in the range G2:G19. And 9 is correct. That's the value in 10th row, but it is the 9th row in the given range.
If you want the row number, either change the range toG1:F19 or add 1 to the formula used.
But the value in B3 is 01:23, which is in G11, the 10th row of the given range, but it returns saying it is the 9th row of the range.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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