Thread: Max date
View Single Post
  #15   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Not real elegant but it works without the need for the helper:

Dates in A2:G2

Array entered:

=MAX(DAY(MIN(IF(MONTH(A2:G2)=MONTH(A2),A2:G2))),DA Y(MIN(IF(MONTH(A2:G2)=MONTH(B2),A2:G2))),DAY(MIN(I F(MONTH(A2:G2)=MONTH(C2),A2:G2))),DAY(MIN(IF(MONTH (A2:G2)=MONTH(D2),A2:G2))),DAY(MIN(IF(MONTH(A2:G2) =MONTH(E2),A2:G2))),DAY(MIN(IF(MONTH(A2:G2)=MONTH( F2),A2:G2))),DAY(MIN(IF(MONTH(A2:G2)=MONTH(G2),A2: G2))))

If the months are always a series of three and they're consecutive:

=MAX(DAY(MIN(IF(MONTH(A2:G2)=MONTH(A2),A2:G2))),DA Y(MIN(IF(MONTH(A2:G2)=MONTH(A2)+1,A2:G2))),DAY(MIN (IF(MONTH(A2:G2)=MONTH(A2)+2,A2:G2))))

If you don't mind hardcoding the months:

=MAX(DAY(MIN(IF(MONTH(A2:G2)=5,A2:G2))),DAY(MIN(IF (MONTH(A2:G2)=6,A2:G2))),DAY(MIN(IF(MONTH(A2:G2)=7 ,A2:G2))))

Couldn't figure out how do do this as a single array statement.

Biff

"Maxi" wrote in message
oups.com...
Good logic but as you said without the helper would be an efficient way
of doing it. Thanks for your efforts even this formula will work out.
Please let me know if you get something better.

Maxi