#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
philcud
 
Posts: n/a
Default Find max date

Hi all,
i have a number of dates in one cell separated by carriage returns
(alt-enter). how can i find the max of these dates?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Domenic
 
Posts: n/a
Default Find max date

Can you provide a sample of the dates contained in a cell?

In article . com,
"philcud" wrote:

Hi all,
i have a number of dates in one cell separated by carriage returns
(alt-enter). how can i find the max of these dates?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid
 
Posts: n/a
Default Find max date

I cannot think of a way to do it that does not involve either VBA or
helper columns. The technique I am suggesting here will involve
creating a column with the individual dates, so that you can then get
the maximum. Assuming the dates are in A1.

In B1:
=FIND(CHAR(10),A1)
In B2:
=FIND(CHAR(10), $A$1, B1+1)
In C1:
=DATE(YEAR(VALUE(LEFT(A1,B1-1))), MONTH(VALUE(LEFT(A1,B1-1))),
DAY(VALUE(LEFT(A1,B1-1))))
In C2:
=DATE(YEAR(VALUE(MID($A$1,B1+1,B2-B1-1))),
MONTH(VALUE(MID($A$1,B1+1,B2-B1-1))),
DAY(VALUE(MID($A$1,B1+1,B2-B1-1))))

Copy down the formulas in B2 and C2 until you get #VALUE!. You can then
get the max of column C:C.

HTH
Kostis Vezerides

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
philcud
 
Posts: n/a
Default Find max date

:-
06 December 2004
03 February 2005

this will be in one cell, so you'll have to paste it into the formula
bar.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid
 
Posts: n/a
Default Find max date

If you choose the technique that I posted earlier, it will also work
with the date format that you are using.

Kostis Vezerides



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Domenic
 
Posts: n/a
Default Find max date

If you change the format of your dates, you'll be able to find the
maximum for the number of dates entered in one cell using a single
formula. So, for example, if you change your dates to the following
format...

06 Dec 2005
03 Feb 2005
15 Mar 2005

....you can use the following formula that needs to be confirmed with
CONTROL+SHIFT+ENTER, not just ENTER...

=MAX(MID(SUBSTITUTE(A1,CHAR(10),""),(ROW(INDIRECT( "1:"&LEN(SUBSTITUTE(A1,
CHAR(10),""))/11))*11-11)+1,11)+0)

If you have a column of cells that need to be changed into this format,
use FIND/REPLACE for each month...

1) Select/highlight your column or range of cells

2) Edit Replace

Find what: December

Replace with: Dec

3) Click Replace All

4) Repeat for each month

Hope this helps!

In article .com,
"philcud" wrote:

:-
06 December 2004
03 February 2005

this will be in one cell, so you'll have to paste it into the formula
bar.

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
philcud
 
Posts: n/a
Default Find max date

unfortunately the way the original spreadsheet is set out it is not
suitable to add 'helper cells' on each row. ive checked with the data
owner and they say its ok to use the first date in a cell, so ended up
using a sumproduct to do counts of dates:-
=SUMPRODUCT(--(((IF(ISERROR(LEFT('Input Data'!$J$7:$J$26,(FIND("
",'Input Data'!$J$7:$J$26)-1))*1),'Input
Data'!$J$7:$J$26,LEFT('Input Data'!$J$7:$J$26,(FIND("
",'Input Data'!$J$7:$J$26)-1))*1))=A2)*((IF(ISERROR(LEFT('Input
Data'!$J$7:$J$26,(FIND("
",'Input Data'!$J$7:$J$26)-1))*1),'Input
Data'!$J$7:$J$26,LEFT('Input Data'!$J$7:$J$26,(FIND("
",'Input Data'!$J$7:$J$26)-1))*1))<A2+7)))

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
Find a date in a list Leonard615 Excel Discussion (Misc queries) 7 May 10th 07 05:43 PM
Another Date issue. TimM Excel Worksheet Functions 1 November 17th 05 01:58 AM
how can i find a specific date of a database reneabesmer Excel Discussion (Misc queries) 16 August 16th 05 11:45 PM
search for latest date Sue Excel Worksheet Functions 2 August 2nd 05 11:09 PM
find date in Col A corresponding to min value in Col B gregl Excel Worksheet Functions 15 November 19th 04 04:01 AM


All times are GMT +1. The time now is 03:02 PM.

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"