A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Comparing dates from VLOOKUP functions not working right



 
 
Thread Tools Display Modes
  #1  
Old June 24th, 2009, 12:38 AM posted to microsoft.public.excel.worksheet.functions
Sambonator
external usenet poster
 
Posts: 2
Default Comparing dates from VLOOKUP functions not working right

I have a spreadsheet with a bunch of VLOOKUP functions that pull dates from
different sheets.

When I try to compare the dates I get incorrect results.
E.g. Vlookup Results in A1 shows 5/15/2009, A2 shows 6/1/2009.
When I compare A1 to A2, =IF(A2A1,TRUE,FALSE) I get FALSE.
If I manually type in 5/15/2009 into B1 and 6/1/2009 into B2, and I do
=IF(B2B1,TRUE,FALSE) I get TRUE.

What might be going wrong here?

  #2  
Old June 24th, 2009, 01:52 AM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Comparing dates from VLOOKUP functions not working right

Sounds like the result of your lookup formula in A1 is a TEXT string and is
not a true Excel date. What result do you get from this formula:

=ISNUMBER(A1)

If A1 contains a true Excel date that formula will return TRUE.


--
Biff
Microsoft Excel MVP


"Sambonator" wrote in message
...
I have a spreadsheet with a bunch of VLOOKUP functions that pull dates from
different sheets.

When I try to compare the dates I get incorrect results.
E.g. Vlookup Results in A1 shows 5/15/2009, A2 shows 6/1/2009.
When I compare A1 to A2, =IF(A2A1,TRUE,FALSE) I get FALSE.
If I manually type in 5/15/2009 into B1 and 6/1/2009 into B2, and I do
=IF(B2B1,TRUE,FALSE) I get TRUE.

What might be going wrong here?



  #3  
Old June 25th, 2009, 02:36 AM posted to microsoft.public.excel.worksheet.functions
Max
external usenet poster
 
Posts: 8,574
Default Comparing dates from VLOOKUP functions not working right

Some thoughts as to how you can get it all going ...

You can convert all the "dates" in col A to real dates recognized by Excel
in one swoop using Data Text to Columns (after selecting col A). In step 3
of the wizard, under Col data format, check "Date", then choose the
appropriate date format from the dropdown, eg: MDY. Click Finish. Now,
everything downstream should compute properly.

Celebrate? Click the YES button below
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:25,000 Files:300 Subscribers:70
xdemechanik
---
"Sambonator" wrote:
I have a spreadsheet with a bunch of VLOOKUP functions that pull dates from
different sheets.

When I try to compare the dates I get incorrect results.
E.g. Vlookup Results in A1 shows 5/15/2009, A2 shows 6/1/2009.
When I compare A1 to A2, =IF(A2A1,TRUE,FALSE) I get FALSE.
If I manually type in 5/15/2009 into B1 and 6/1/2009 into B2, and I do
=IF(B2B1,TRUE,FALSE) I get TRUE.

What might be going wrong here?

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:52 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.