Date/Time
Come to think of it, you don't need the DAY functions:
=--(A1=EOMONTH(A1,0))
=--(A1=DATE(YEAR(A1),MONTH(A1)+1,0))
--
Biff
Microsoft Excel MVP
"T. Valko" wrote in message
...
The resaon your formula doesn't work is because NOT evaluates to FALSE.
Try one of these:
This one requires the Analysis ToolPak add-in be installed (if using Excel
versions prior to Excel 2007):
=--(DAY(A1)=DAY(EOMONTH(A1,0)))
This one works in all versions of Excel (ATP not required):
=--(DAY(A1)=DAY(DATE(YEAR(A1),MONTH(A1)+1,0)))
--
Biff
Microsoft Excel MVP
"cmatera" wrote in message
...
Trying to determine if the date and the time in a cell are the last
day of the month, and if that's the case I want to perform a certain
operation.
Here's what I have so far:
=IF(NOT(DATE(YEAR(A1),MONTH(A1)+1,0)),1,0)
A1 is 2/29/08
My formula returns 0, I would expect this to return a 1 as 2/29/08 IS
the last day of February...
Any ideas why this might not be working?
Thanks
Chris
|