Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing dates Gareth.Evans Excel Worksheet Functions 0 March 26th 09 08:54 AM
Comparing Dates fubdap Excel Discussion (Misc queries) 3 September 27th 07 03:53 PM
COMPARING DATES with nested IF not working- Syntax is correct though Richard Flame Excel Discussion (Misc queries) 2 July 12th 06 07:04 PM
VLOOKUP & Dates: Why is this Formula working? Ali Excel Worksheet Functions 1 January 18th 06 01:37 PM
Comparing dates Debbie F Excel Worksheet Functions 7 September 7th 05 11:57 AM


All times are GMT +1. The time now is 05:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"