Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
gwc gwc is offline
external usenet poster
 
Posts: 62
Default compare dates with different formats

What Excel formula can I use to determine if the date in each row in Col B is later (i.e., later) than the date in Col A?

A B
12111995 01/10/1996
11012007 01/23/2008
02282009 05/11/2009
06061989 09/13/1989

(I can't use macros or VBA)






  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default compare dates with different formats

Hi,

Am Mon, 3 Dec 2012 10:46:48 -0800 (PST) schrieb GWC:

A B
12111995 01/10/1996
11012007 01/23/2008
02282009 05/11/2009
06061989 09/13/1989


try:
=B1DATE(RIGHT(A1,4),LEFT(A1,2),MID(A1,3,2))


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 829
Default compare dates with different formats

"GWC" wrote:
What Excel formula can I use to determine if the date
in each row in Col B is later (i.e., later) than the
date in Col A?
A B
12111995 01/10/1996
11012007 01/23/2008
02282009 05/11/2009
06061989 09/13/1989


Normally, the format of a date does not matter. If column A contains Excel
dates simply formatted as Custom mmddyyyy, you can simply do
IF(B1A1,"later","not later").

However, if column A contains those values as integers (formatted as Custom
00000000?) or as strings, you will need to convert them.

IMHO, it would be best to convert all of the dates in column A. The Text To
Column operation might do the job. But IIRC, it has problems with certain
ambiguous representations, despite the leading zeros. Test or review the
results carefully.

If you do not want to convert all of the dates in place, you can do the
following:

IF(B1--TEXT(A1,"00\/00\/0000"),"later","not later")

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
Dates in different formats David Biddulph[_2_] Excel Discussion (Misc queries) 0 December 8th 09 10:45 AM
Dates in different formats Pete_UK Excel Discussion (Misc queries) 0 December 8th 09 09:31 AM
compare 2 tables of dates to find the preceding dates Babi Excel Worksheet Functions 3 October 28th 08 05:52 AM
dates and formats Jenny dev New Users to Excel 1 July 21st 08 04:03 PM
compare cell formats Gary''s Student Excel Programming 6 June 8th 06 09:29 PM


All times are GMT +1. The time now is 06:47 AM.

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"