+ Reply to Thread
Results 1 to 20 of 20

Select the earliest date

  1. #1
    Registered User
    Join Date
    12-31-2007
    Posts
    33

    Pick the earliest and latest Date

    Could any body please help me with a formula to pick a first and last date from two lists of dates.

    I have attached a spreadsheet to show the exact problem.

    Thanks

    Peter
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    10-14-2004
    Location
    San Diego, CA
    Posts
    213
    PRW:

    Paste this formual in cell F9 and copy down.

    Please Login or Register  to view this content.
    Paste this formula in cell DP9 and copy down.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-31-2007
    Posts
    33
    Hello Flintstone.

    Thanks for your help

    The problem now is that I'm now getting a date code as the result, instead of the actual date.

    Peter

  4. #4
    Forum Contributor
    Join Date
    10-14-2004
    Location
    San Diego, CA
    Posts
    213
    Peter:

    When you say date code, it sounds like a format problem; select cells DP9:DP15 and click Format/Format cells, the Format Cells dialog box will open make sure the Number Tab is selected and click Date in the category list.

  5. #5
    Registered User
    Join Date
    12-31-2007
    Posts
    33
    Yes you were quite right, it was the format settings.

    Flintstone, many thanks indeed, thats one more problem on my programme sorted out.

    Peter.

  6. #6
    Registered User
    Join Date
    12-31-2007
    Posts
    33

    Select the earliest date

    Hello,

    I wonder if any one can help me with a date problem.

    I have a series of cells with dates in. and what I want to do is insert a formula to select the earliest date in the year, which will not necessarily be the earliest year so from the following examples the 04-May-08 would be selected.

    17-Jun-07, 13-Sep-05, 04-May-08.

    If I write MIN. in the formula I just get the earliest date in the earliest year, has anybody got any ideas.

    Thanks

  7. #7
    Registered User
    Join Date
    12-31-2007
    Posts
    33

    Select the earliest date

    Hello,

    I wonder if any one can help me with a date problem.

    I have a series of cells with dates in. and what I want to do is insert a formula to select the earliest date in the year, which will not necessarily be the earliest year so from the following examples the 04-May-08 would be selected.

    17-Jun-07, 13-Sep-05, 04-May-08.

    If I write MIN. in the formula I just get the earliest date in the earliest year, has anybody got any ideas.

    Thanks

  8. #8
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    Here's one way, but there may well be a shorter or easier way?

    With your list of dates in column A, use a couple of "helper" columns, put this in B2 and copy down

    =MAX(YEAR($A$2:$A$8)) Enter as an array Ctrl+Shift+Enter to enclose the formula in { }, then in C2

    =IF(A2>=DATE(VALUE(B2),1,1),A2,"") copy down

    Then in D2 to get the date you want

    =MIN(C2:C8)

    Example attached
    Attached Files Attached Files
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,736
    If your dates are in A1:A10 then this array formula will give you the date which is earliest in the year, irrespective of the year:

    =MAX(IF(TEXT(A1:A10,"mmdd")+0= MIN(TEXT(A1:A10,"mmdd")+0),A1:A10))

    confirm with CTRL+SHIFT+ENTER

    Note: if the list contains two or more dates with the same day and month but in different years, e.g. 6th June 2007 and 6th June 2001, it'll select the most recent....

  10. #10
    Registered User
    Join Date
    12-31-2007
    Posts
    33
    Hello Old Chippy,

    Thanks for your help but the result you have given me isn't quite right.

    You have now given me the earliest date in one year, I actually want the earliest date of the year from all the years in the list.

    Therefore from these options 24-Jul-05, 19-Aug-06 and 07-Jan-07.

    07-Jan-07 would be the answer because its the earliest date in the year. I hope this is a little easier to understand.

    Thanks Peter

  11. #11
    Registered User
    Join Date
    12-31-2007
    Posts
    33
    Hello daddylonglegs,

    Many thanks your formula seems to work well but it has to be placed within existing formula, and I don't know where to put it, so I have inserted a small section of the spreadsheet that I'm using to show you what the situation is, hope this is ok.

    In fact on the attached spreadsheet in column "F" I need the earliest date recorded and in column "G" I need the lasest date recorded.

    Thanks Peter.
    Attached Files Attached Files

  12. #12
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,736
    It makes it a bit more complicated if you have text and dates mixed in the same column....

    See cells F12 and G12

    Note: these are array formulas which need to be confirmed with CTRL+SHIFT+ENTER so that curly braces like { and } appear around the formula in the formula bar
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    12-31-2007
    Posts
    33
    Hello daddylonglegs,

    Thanks for your help but I'm afraid we are still not quite there.

    Your formula is great it does the exact job I need, but you were relating it to columns "F" and "G". What I should have said to you is that each date in Columns "F" and "G" are the result of 25 other cells in each row.

    eg the date in "F4" is the result from dates in "AR4:BQ4".
    eg The date in "G4" is the result from dates in "BS4:CR4".

    So if you click on "F4" and "G4" this is where your formulas must be pasted and then dragged down, the problem is that I don't know where to put your formula in relation to the formula that already is in each cell.

    There an added factor as I'm sure you can see. If there are arn't any dates in any of the rows "AR4:BQ10"and "BS4:CR10". The answer that has to be returned must be "None".

    Thanks again, Peter.
    Attached Files Attached Files

  14. #14
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,736
    OK, I see. Try this version......
    Attached Files Attached Files

  15. #15
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi Peter,

    Thanks for your help but the result you have given me isn't quite right.

    You have now given me the earliest date in one year, I actually want the earliest date of the year from all the years in the list.
    Sorry, miss read the question - common error of mine!

    If there's anyone here who's good with dates - that's daddylonglegs - he's on the case - you're in luck!

  16. #16
    Registered User
    Join Date
    12-31-2007
    Posts
    33
    Hello oldchippy,

    Thanks for keeping on the case. I feel that daddylonglegsis nearly there. You're a great team.

    All the best

    Peter.

  17. #17
    Registered User
    Join Date
    12-31-2007
    Posts
    33
    Hello daddylonglegs,

    Column "F" seems fine but there is still an issue with column "G" that selects the latest date.

    I have changed your formula in column "G4" so that the answer is taken from "BS4:CR4" and then copied it down (You accidently left the cell range from the cells that give the earliest date).

    But now the latest date answers in "G4:G10" is giving me a list of answers that say 00-Jan-00 something isn't quite right, I have tried checking the formula through and can't see what the problem is.

    Thanks, Peter.
    Attached Files Attached Files

  18. #18
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    As daddy says
    Note: these are array formulas which need to be confirmed with CTRL+SHIFT+ENTER so that curly braces like { and } appear around the formula in the formula bar

  19. #19
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,736
    Ah, I didn't look closely enough, I didn't realise that column G used a different range.....

    Formula is OK but it needs to be confirmed with CTRL+SHIFT+ENTER in order to return the correct result.

    If you look at formula in F2 you'll see that it is surrounded by curly braces like { and }, this is the result of CTRL+SHIFT+ENTER

    To do that....

    Select cell G2, press F2 on keyboard, hold down CTRL and SHIFT keys and press ENTER. Curly braces should appear around the formula in the formula bar and you should see the correct date. Now copy formula down column

    Any time you change these sort of formulas you lose the curly braces so you need to re-confirm.....

  20. #20
    Registered User
    Join Date
    12-31-2007
    Posts
    33
    Hello daddylonglegs,

    You are the man.

    Everything works great on small section of spreadsheet that I sent you. Now I must check to see all is well on the original spreadsheet.

    Thanks again, this has been a big effort on your part I really appriciate it.

    Peter.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1