Earlest Date Based On A Date Using Min Formula

C

Cue

I'm triyng to get the earlest date under DATE1 (coloumn A) based on a date
under DATE 2 (coloumn B) by using the MIN formula.

DATE 1 DATE 2
4/30/2008 4/30/2008
4/30/2008 4/30/2008
4/29/2008 4/30/2008
4/28/2008 4/29/2008
4/27/2008 4/29/2008

=MIN(IF(B2:B6="4/30/2008",A2:A6))

4/27/2008 is the answer I get. But it should be 4/29/2008. Can someone show
the correct formula for this?
 
G

Gary''s Student

=MIN(IF(B2:B6=DATEVALUE("4/30/2008"),A2:A6))

Must be entered as a Array Formula (enter with CNTRL-SHFT-ENTER rather than
just the ENTER key)
 
C

Cue

It works for the data below. Thanks Gary. But I also have another similar
spreadsheet with about 15k rows of dates. Column A has blanks cells. So when
I used the Array Formula, it gives me a value of 0. Any suggestions?
 
T

T. Valko

Try this...

A1 = your date variable

Array entered:

=MIN(IF((Date2=A1)*(Date1<>""),Date1))

Format as Date
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top