Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default find latest date in a row, when dates have apostrophes in it

hi,

i have the folowing problem, i want to find the latest date in a row,
the dates have the format mmm-yy.
the problem is that the MAX function won't work because some of the
dates have apostrophes in it.
the date looks like 04-'02 for example.

I already tried to delete the apostrophes with a Macro, but excel
thinks then that the date format= day-month,
so the actual date then presented with above example is 4 feb, and not
april 2002.

Does anyone know how to solve this problem?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 287
Default find latest date in a row, when dates have apostrophes in it

Probably best to convert your "dates" to real dates, then you can use MAX

Assuming the ones formatted as mmm-yy are actually dates (and not text) then
use this formula to convert your non-dates to dates whilst leaving the true
dates alone

=IF(ISTEXT(A1),DATE(100+RIGHT(A1,2),LEFT(A1,2),1), A1)

where your "date" is in A1

"brakbek" wrote:

hi,

i have the folowing problem, i want to find the latest date in a row,
the dates have the format mmm-yy.
the problem is that the MAX function won't work because some of the
dates have apostrophes in it.
the date looks like 04-'02 for example.

I already tried to delete the apostrophes with a Macro, but excel
thinks then that the date format= day-month,
so the actual date then presented with above example is 4 feb, and not
april 2002.

Does anyone know how to solve this problem?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,718
Default find latest date in a row, when dates have apostrophes in it

Let's say your dates in column A A2:A100
Create a Helper in column B

B2 =IF(ISNUMBER(A1),A1,DATE(2007,RIGHT(A1,2),LEFT(A1, 2)))
copy from B2 to B100

C2 =MAX(B2:B100)


"brakbek" wrote:

hi,

i have the folowing problem, i want to find the latest date in a row,
the dates have the format mmm-yy.
the problem is that the MAX function won't work because some of the
dates have apostrophes in it.
the date looks like 04-'02 for example.

I already tried to delete the apostrophes with a Macro, but excel
thinks then that the date format= day-month,
so the actual date then presented with above example is 4 feb, and not
april 2002.

Does anyone know how to solve this problem?


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 287
Default find latest date in a row, when dates have apostrophes in it

Note: my suggestion won't cope with dates before 2000. If you have those
amend to

=IF(ISTEXT(A1),DATE(IF(RIGHT(A1,2)"30",0,100)+RIG HT(A1,2),LEFT(A1,2),1),A1)



"daddylonglegs" wrote:

Probably best to convert your "dates" to real dates, then you can use MAX

Assuming the ones formatted as mmm-yy are actually dates (and not text) then
use this formula to convert your non-dates to dates whilst leaving the true
dates alone

=IF(ISTEXT(A1),DATE(100+RIGHT(A1,2),LEFT(A1,2),1), A1)

where your "date" is in A1

"brakbek" wrote:

hi,

i have the folowing problem, i want to find the latest date in a row,
the dates have the format mmm-yy.
the problem is that the MAX function won't work because some of the
dates have apostrophes in it.
the date looks like 04-'02 for example.

I already tried to delete the apostrophes with a Macro, but excel
thinks then that the date format= day-month,
so the actual date then presented with above example is 4 feb, and not
april 2002.

Does anyone know how to solve this problem?


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
Date formulas DRondeau Excel Discussion (Misc queries) 7 September 6th 06 09:53 PM
Find date query and Display issue VBA Noob Excel Worksheet Functions 2 July 14th 06 11:23 PM
Deleting time part of a Date, subtracting dates Shirley Munro Excel Discussion (Misc queries) 3 June 21st 06 11:58 AM
Determining Date X based on Other dates MIchel Khennafi Excel Worksheet Functions 1 May 3rd 06 04:45 PM
Traffic Light Filter On Dates JPG Excel Discussion (Misc queries) 3 April 17th 06 12:32 AM


All times are GMT +1. The time now is 08:59 AM.

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

About Us

"It's about Microsoft Excel"