Problem using VLOOKUP with calculated values - for dissertation!

ljohnston86

New Member
Joined
Aug 17, 2011
Messages
2
Hi, I'm trying to use the VLOOKUP formula at the moment, and having a few problems. I have a very long list of dates in a main dataset, and I need to calculate the sunrise time that occurred on each date. I have a separate worksheet containing all of the sunrise times. As my original date variable also contained times, which I don't need, I extracted the dates only from this variable into a new variable called 'dates'.

However, I can't seem to use VLOOKUP on these calculated values, it says #NA. If I try to replace the date with one I've typed manually, the VLOOKUP formula works fine. I've tried to copy and paste the date values using the 'Paste Special - Values' feature, thus converting it from a calculation to a value only, however this makes no difference. So to clarify - when I have the date 20/07/2007 in the cell, VLOOKUP won't work. If I erase the cell and type the date in exactly the same way, it works. I've tried reformatting the cell to both 'general' and 'date', neither of which works.

Any assistance would be greatly appreciated, it's for my dissertation which is due in a month!
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
When you extract your dates from your original date variable, use the following to calculate your date as text: =text(date variable,"dd/mm/yyyy"). If you're still encountering NA's...convert the values you're looking up in the same way.
 
Upvote 0
Thank you both so much for your help! Turns out when I checked the length of the two fields (in main dataset and in VLOOKUP table), they were different, so no wonder it didn't work!

:)
 
Upvote 0

Forum statistics

Threads
1,224,567
Messages
6,179,571
Members
452,927
Latest member
whitfieldcraig

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