View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom Peo Sjoblom is offline
external usenet poster
 
Posts: 3,268
Default EOMONTH to compare two dates (Excel 2003)

How does your real formula look?



--


Regards,


Peo Sjoblom


"sithjanitor" wrote in message
...
I have two sets of dates. The benchmark is the first FULL month after the
first date. Thus, if the first date occurs on the first of the month -
the
starting month counts as the first month. Otherwise, the first month is
the
month following the start. (i.e. - if the first date is 5/1/yy and the
second is 5/15/yy, May is the first month. Otherwise, any other date in
May
causes June to be the first month).

I have the Analysis Toolpak installed and have used EOMONTH by itself. It
works fine. Generates dates, evaluates logically, etc, BUT ONLY ON ONE
SIDE
OF AN EQUATION.

The formula I have tried produces a #NAME? error:
=IF(AND(DAY({date1})1,EOMONTH({date1},0)=EOMONTH( {date2},0)),{thishappens},{thathappens})

I produced this formula in the formula editor. The EOMONTH function
evaluates correctly ({date1} of 5/5/yy evaluates to 5/31/yy). The DAY
function evaluates correctly. The IF function evaluates to #NAME? at the
logical_test. The AND function evaluates to #NAME? at the logical2
condition. The formula editor result is blank, as is my experience when
there is some type of problem in the formula. However, the cell displays
the
{thishappens} (ie -TRUE) outcome.

I realize this is lengthy, but the formula makes sense to me but the
result
does not. I wanted the knowledgeable expert to be able to easily
duplicate
my efforts.

Any suggestions would be great, even if it works around the EOMONTH
function.
--
Thanks,
sithjanitor