Date Fields Comparison

  • Thread starter Thread starter Ify
  • Start date Start date
I

Ify

I WILL LIKE TO COMPARE TWO DATE FIELDS IN A ROW AND SELECT THE CELL
WITH THE GREATEST NUMBER OF DAYS IN THE MONTH FOR THE ROW. WHA
FORMULA WILL ENABLE ME TO ACHIEVE THIS , PLEASE. THE ROW IN QUESTIO
IS ABOUT 5000
SEE EXAMPLE BELOW.

DATE 1 DATE 2 RESULT EXPECTED
08/04/04 09/05/04 08/04/04
01/04/04 30/04/04 30/04/0
 
Hi
first: please turn-off your CAPS Lock: Makes it difficult to read
For your question: Why did you choose 08/04/04 in the first row? Date 2
has 9 days?
 
I'm confused, too.

But you can compare the number of days in one month with the number of days in a
second month with a formula like:

=IF(DATE(YEAR(A1),MONTH(A1)+1,0)>DATE(YEAR(B1),MONTH(B1)+1,0),A1,B1)

The zeroeth day of one month is the last day of the previous month.

And I guessed your dates were formatted as dd/mm/yy.

And May (May 9, 2004) has more days than April (April 8, 2004). So I didn't get
your expected results.
 

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

Back
Top