TIME VLOOKUP returning #N/A value

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,602
Office Version
  1. 365
Platform
  1. Windows
Hi all

I'm having trouble getting a simple VLOOKUP to return a time value

Simple data is shown below

Overtime.xlsx
BCDEFGHI
105:5809:0003:02#N/A03:0000:00
203:0100:15
303:0200:30
403:0300:45
503:0401:00
6
Sheet1
Cell Formulas
RangeFormula
D1D1=C1-B1
E1E1=VLOOKUP(D1,H1:I5,2,FALSE)


so D1 is the time value between C1 and B1, I simple want the Value of D1 (03:02 in this example) to be searched in the table
E1 should bring back the time value of 00:30 but I'm getting the #N/A error

any help appreciated, assume its how I have the data stored but can't figure out what to do
]
Thanks
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hello
I think it is better to enter TRUE and not FALSE

It's to say =VLOOKUP(D1,H!:I5,2,TRUE)

Hello,
Mario
 
Upvote 0
Hello
I think it is better to enter TRUE and not FALSE

It's to say =VLOOKUP(D1,H!:I5,2,TRUE)

Hello,
Mario
By using TRUE this doesn't give an exact match in the table...using TRUE in this example wil retuen the value 00:15 from the VLOOKUP whereas it should return 00:30
 
Upvote 0
Hello
You're right!
Add a column between H and I in the table with this formula
= ROUND (G1; 5)
In D1 = ROUND (C1-B1; 5)
in E1
= VLOOKUP (D1, H1: I5,2, FALSE)
Sorry for the wrong suggestion earlier.
Hello,
Mario

Icona di Verificata con community
 
Upvote 0
Solution
Hello
You're right!
Add a column between H and I in the table with this formula
= ROUND (G1; 5)
In D1 = ROUND (C1-B1; 5)
in E1
= VLOOKUP (D1, H1: I5,2, FALSE)
Sorry for the wrong suggestion earlier.
Hello,
Mario

View attachment 63099
Had to use =ROUND(G1,5) and not =ROUND(G1;5) but think thats now working as desired

Many thanks @Marius44 , appreciate your help
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,181
Members
449,071
Latest member
cdnMech

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