Consulting

Results 1 to 7 of 7

Thread: Solved: Formula needed to match dates with MIN & MAX values

  1. #1

    Solved: Formula needed to match dates with MIN & MAX values

    I have a worksheet that contains a date in column B and a value in column C.
    Cell "C2" contains a MAX formula & cell "C3" a MIN formula for all the values below them in column C.

    What I would like to do is to put a formula in "B2" & "B3" that returns the corresponding date on which those values occur.
    If there is more than one date that a MAX or MIN occurs, then to return the latest date.

    Much appreciate any help.

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    Are the dates sorted? If so, most recent at the top or most recent at the bottom? (I'm looking at using Match, and want to know if the first match will return the right date).
    p45cal
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    The most recent date is at the bottom.
    The operator puts in a value each day and the monthly report requires the date on which the min & max value occured.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    =MAX(IF($C$4:$C$15=C2,$B$4:$B$15))

    =MIN(IF($C$4:$C$15=C3,$B$4:$B$15))

    which is an array formula, it should be committed with Ctrl-Shift-Enter, not just Enter.Excel will automatically enclose the formula in braces (curly brackets), do not try to do this manually.When editing the formula, it must again be array-entered.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Thanks xld......
    the max formula works, but the min formula is returning the earliest date, not the latest date?

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Sorry, my Faux-pas. They should both be MAX then.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    thanks .... works perfectly.

Posting Permissions

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