formula to return lowest value in a range

  • Hi,


    I am trying to set up a cell formula that looks in a range for all records that match a given text value (here, an animal type), and returns a blank if any associated records in the lookup range are blank, or return the latest date time value if no associated records are blank. There could be varying numbers of records associated with each text value.


    Any help would be very much appreciated. Thank you in advance!
    [TABLE="border: 1, cellpadding: 1, width: 500"]

    [tr]


    [td]

    [TABLE="border: 0, cellpadding: 0, cellspacing: 0"]

    [tr]


    [TD="class: xl68, width: 80"]animal type

    [/tr][/td][tr]


    [TD="class: xl69, width: 106"]checkup date[/TD]
    [TD="width: 35"] [/TD]
    [TD="width: 64"] [/TD]
    [TD="width: 216"]formula returns these values:[/TD]

    [/tr]


    [tr]


    [TD="class: xl65"]dog[/TD]
    [TD="class: xl71, align: right"]1/1/2017 16:46[/TD]

    [td][/td]


    [td]

    dog

    [/td]


    [TD="class: xl72"] [/TD]

    [/tr]


    [tr]


    [TD="class: xl66"]dog[/TD]
    [TD="class: xl70, align: right"]1/2/2017 16:46[/TD]

    [td][/td]


    [td]

    cat

    [/td]


    [TD="class: xl73, align: right"]3/4/2017 19:46[/TD]

    [/tr]


    [tr]


    [TD="class: xl66"]dog[/TD]
    [TD="class: xl70, align: right"]1/3/2017 16:46[/TD]

    [td][/td]


    [td]

    fish

    [/td]


    [TD="class: xl74, align: right"]9/3/2017 13:22[/TD]

    [/tr]


    [tr]


    [TD="class: xl66"]dog[/TD]
    [TD="class: xl75"] [/TD]

    [td][/td]


    [td][/td]


    [td][/td]


    [/tr]


    [tr]


    [TD="class: xl66"]dog[/TD]
    [TD="class: xl70, align: right"]1/5/2017 16:46[/TD]

    [td][/td]


    [td][/td]


    [td][/td]


    [/tr]


    [tr]


    [TD="class: xl66"]cat[/TD]
    [TD="class: xl70, align: right"]3/1/2017 16:46[/TD]

    [td][/td]


    [td][/td]


    [td][/td]


    [/tr]


    [tr]


    [TD="class: xl66"]cat[/TD]
    [TD="class: xl70, align: right"]3/2/2017 17:46[/TD]

    [td][/td]


    [td][/td]


    [td][/td]


    [/tr]


    [tr]


    [TD="class: xl66"]cat[/TD]
    [TD="class: xl70, align: right"]3/3/2017 20:46[/TD]

    [td][/td]


    [td][/td]


    [td][/td]


    [/tr]


    [tr]


    [TD="class: xl66"]cat[/TD]
    [TD="class: xl75, align: right"]3/4/2017 19:46[/TD]

    [td][/td]


    [td][/td]


    [td][/td]


    [/tr]


    [tr]


    [TD="class: xl66"]fish[/TD]
    [TD="class: xl70, align: right"]9/1/2017 13:22[/TD]

    [td][/td]


    [td][/td]


    [td][/td]


    [/tr]


    [tr]


    [TD="class: xl66"]fish[/TD]
    [TD="class: xl70, align: right"]9/2/2017 13:22[/TD]

    [td][/td]


    [td][/td]


    [td][/td]


    [/tr]


    [tr]


    [TD="class: xl67"]fish[/TD]
    [TD="class: xl75, align: right"]9/3/2017 13:22[/TD]

    [td][/td]


    [td][/td]


    [td][/td]


    [/tr]


    [/TABLE]
    [/TD]

    [/tr]


    [/TABLE]

  • Assuming your range is in A2:B13 and your lookup values are in D2:D4, then in E2 try:


    =IF(COUNTIFS($A$2:$A$13,D2,$B$2:$B$13,"")>0,"",LOOKUP(2,1/($A$2:$A$13=D2),$B$2:$B$13))


    copied down


    Note: You might have to format your results as Date/Time

    Where there is a will there are many ways. Finding one that works for you is the challenge!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!