[Solved] VLOOKUP to find matching dates?

Discuss the spreadsheet application
Post Reply
CaliRay
Posts: 71
Joined: Sun Apr 26, 2009 6:20 pm

[Solved] VLOOKUP to find matching dates?

Post by CaliRay »

This should be so simple but I can't make it work.
Criteria: Column A is a list of dates in mm/dd/yyyy format. All column B cells contains either a number or is empty.
All column A cells are formatted as dates. Same for cell C2.
Cell C2 contains a test date. Cell D2 is empty.
I hope to use vlookup to search column A for a date in the range A2-A366 to find the date that matches C2 and return in D2 the value found in the cell to the right of the match found in the range A2:A366.
Example: If test cell C2 has a date of 6/10/1963, the matching date of 6/10/1963 is in A162 and B162 has some value, say -250, then cell D2 should be filled with the value found in B162, otherwise it should be filled with text of "Not Tested".

It seems from reading examples and other help requests this should be a very simple formula but everything I try comes back with #VALUE!.
Last edited by CaliRay on Thu Jul 13, 2017 10:54 pm, edited 1 time in total.
OOo 4.1.3 on Windows 10 Home
User avatar
Zizi64
Volunteer
Posts: 11360
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: VLOOKUP to find matching dates?

Post by Zizi64 »

It seems from reading examples and other help requests this should be a very simple formula but everything I try comes back with #VALUE!.
Please upload your ODF type sample file here.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: VLOOKUP to find matching dates?

Post by Villeroy »

=VLOOKUP(C2;$A$2:$B$366;2;0)
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
CaliRay
Posts: 71
Joined: Sun Apr 26, 2009 6:20 pm

Re: VLOOKUP to find matching dates?

Post by CaliRay »

Date lookup ods file attached.
Attachments
date checked vlookup.ods
(14 KiB) Downloaded 264 times
OOo 4.1.3 on Windows 10 Home
CaliRay
Posts: 71
Joined: Sun Apr 26, 2009 6:20 pm

Re: VLOOKUP to find matching dates?

Post by CaliRay »

Villeroy wrote:=VLOOKUP(C2;$A$2:$B$366;2;0)
Thank you. Tried the formula. It works fine. Is there an option to fill D2 with text when a number value is not found?
OOo 4.1.3 on Windows 10 Home
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: VLOOKUP to find matching dates?

Post by Villeroy »

=IF(ISNA(VLOOKUP(C2;$A$2:$B$366;2;0));"Date not found in A";IF(NOT(ISNUMBER(VLOOKUP(C2;$A$2:$B$366;2;0)));"no number at matching date";VLOOKUP(C2;$A$2:$B$366;2;0)))
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply