VLOOKUP with Dates not working

Lefty099

New Member
Joined
Jan 24, 2016
Messages
26
Hi all, hopefully this will be a simple one for you.

I am looking for a formula that I can put in a table to do the following.

Sheet1 Column C has a list of my products. Column E contains the date the goods were received.
(For some reason, and it is unavoidable unfortunately, the report the data comes from on sheet 1 posts 2 rows for the same product with a true date and a 0 on the next row. I have put an example down below.


Sheet 2 Column B has a formula transferring the product name across from sheet1.

Sheet2 Column C should have the corresponding date from sheet1.

=VLOOKUP(B4,Sheet1!B1:e20000,Not Valid,FALSE) isnt working.

any suggestions would be greatly appreciated.

Sheet1
CDEF
1Hammer23/06/2015
2Hammer0
3Wrench17/01/2012
4Wrench0

<tbody>
</tbody>


Sheet2
ABCD
1Hammer23/06/15
2Wrench17/01/12
3
4

<tbody>
</tbody>


I have no VBA experience hence why I am chasing formulas to do this.

Thanks in advance.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hi Lefty099,

Try putting this formula in cell C1 of Sheet2 and filling down as required:

=VLOOKUP(B1,Sheet1!C:E,3,FALSE)

Regards,

Robert
 
Upvote 0
Strange it works for me :confused:

If the text in cell B1 is not exactly the same as in column C of Sheet1 it will return #N/A

Ensure there are no trailing spaces in each cell for column B of Sheet2 and column C of Sheet1.
 
Last edited:
Upvote 0
From what I can gatherI need to put a query in to make sure the daye is above 01/01/1900 or something like that. Way over my head on this one.

Thanks
 
Upvote 0
The text is a mirror image as I have it copying across from the another sheet. the data transfer across the sheets is automated..
 
Upvote 0
I just went through and made sure all those columns are formatted to date, it is now returning me 0/01/1900 instead of the 12/02/2016 which is the actual date for that product.

With the example I pasted up the op I had the date in E1 then the 0 in E2, it is the other way round, 0 in E1, 23/06/15 in E2.

Sorry, my bad
:p
 
Upvote 0
That makes sense. The VLOOKUP is working - when there are multiple matches it returns the first value it finds which in this case is a zero. A zero formatted as a date returns 01/01/1900 as this is the starting date used by Excel.

Sorting the data in Sheet1 by the date column (column E) by largest to smallest should do the trick.

Robert
 
Upvote 0
Hi Lefty099, give this a try

=INDEX(Sheet1!E:E, ROW(Sheet1!E1) + 1 * (ROWS($C$1:C1) - 1))

Following your example paste it in c1 and drag down.

where Sheet1!E:E is the column with data to pick
Sheet1!E1 is the first cell to pick data from
1 is the gap
$C$1 is the cell in target sheet where you first insert formula
ROWS($C$1:C1) it is the range whose rows help you picking 1 each n

Hope this helps you.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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