View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Ron Coderre Ron Coderre is offline
external usenet poster
 
Posts: 2,118
Default Match Last day of this month to last day of last month

Try something like this:

With
A1 containing the 1st day of a month
Cells below A1 contain subsequent dates of that month

This formula begins displaying the dates of the previous month, but aligning
the dates so the prev month end dates corresponds to the Col_A month end date.
B1:=IF((DAY(EOMONTH(A1,0))-DAY(EOMONTH(A1,-1)))=DAY(A1),"na",A1-DAY(EOMONTH(A1,0)))

Example:
A1: 3/1/2006
B1: na
A2: 3/2/2006
B2: na
A3: 3/3/2006
B3: na
A4: 3/4/2006
B4: 2/1/2006


Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"KCi" wrote:

Hi All, I have a question that I have not been able to answer on my own.
I have to compare calendar days in this month vs prior month, but I need the
last days to line up (so essentially, start in reverse) so month a will have
30 days and month b will have 31 days I need for month b to start on day two
as the comparison. The days (and values) of the two months increment each day
for the current month, prior month is established and filled.

If this is not clear (which I am sure it's not) let me know,
any help would be much appreciated...