Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default EOMONTH to compare two dates (Excel 2003)

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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default EOMONTH to compare two dates (Excel 2003)

I'm not sure if you can make use of this or not, but given {date1}, this
formula formula will calculate the first day of the full month on (if the
1st of the month) or after {date1}...

DATE(YEAR({date1}),MONTH({date1})+(DAY({date1})1) ,1)

So, if I read your formula's intention correctly, I **think** you can use
this instead....

=IF(MONTH(DATE(YEAR({date1}),MONTH({date1})+(DAY({ date1})1),1))=MONTH({date2}),{thathappens},{thish appens})

Note the reversal of your {thishappens} and {thathappens}.

Rick


"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


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default EOMONTH to compare two dates (Excel 2003)

On Fri, 6 Jun 2008 11:46:02 -0700, sithjanitor
wrote:

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.


I don't understand exactly what you are trying to do. But to generate the
first of a month, if date1 is on the first; and the first of the month, if
date1 is later than the first, you can use the formula:

=EOMONTH(date1,-1+(DAY(date1)1))+1

or

--ron
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default EOMONTH to compare two dates (Excel 2003)

Let me retry this:
Two things have to happen:
1) Item is placed in service/made available - first month's availability is
determined as of the end OF THE FIRST FULL month. So, item made availabe
5/1/08 is available for the FULL month of May, thus May counts. If made
available the 2nd, 5th, 25th or 30th, June becomes the first FULL month
available.
2) Item is leased/purchased/put into use - subject to the above, this is
simply determined as of the end of the month leased. Thus, leased 5/31/08 is
leased in May because it is leased as of the end of May.

So, a unit leased 5/25/08 would not count the month of May unless it was
placed in service 5/1/08. Although leased at the end of May, it had not been
a full month since placed in service. So it's first month would be June.

This is the formula I started with:
=IF(AND(DAY(D43)1,EOMONTH(D43,0)=EOMONTH(E43,0)), 0,1)
column D is Dates Placed in Service
column E is Dates Put into Use/Leased

Thus, if the DAY in D43 is higher than 1, AND the EOMONTH of E43 is the same
as D43, result is 0 - don't count the month. This is because the month
placed in service is the same as the month leased, but the unit has not been
in service a FULL month (DAY is greater than 1). Otherwise, count the month
(result = 1).

--
Thanks,
sithjanitor


"sithjanitor" wrote:

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 Student compare to standard edition Yar1964 Excel Discussion (Misc queries) 3 January 10th 08 03:19 PM
Excel Analysis Add-in EOMONTH generates #NAME? error Ray Excel Worksheet Functions 6 July 18th 05 07:00 PM
how to enable compare and merge workbooks in excel 2003 tjp2700 Setting up and Configuration of Excel 3 April 25th 05 09:35 PM
How about adding a quarterly function to Excel like its EOMonth? SDolley Excel Worksheet Functions 1 March 30th 05 06:58 PM
Tools/Compare and Merge Workbooks - Excel 2003 Pro Laura Excel Worksheet Functions 1 January 3rd 05 05:45 PM


All times are GMT +1. The time now is 08:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"