Remember Me?

#1
Posted to microsoft.public.excel.programming
 external usenet poster Posts: 7
A formula or macro that determine the correct month

Hi there,
I have been trying out different methods for this dilemma for a long
time, I am trying to create a logic that can look at a billing start
cycle and billing end cycle dates and compare the days between the two
then assign a month based on the one with the most days.

here is an example, lets say the billing cycle starts 12/18/05 and ends

1/19/06, now the logic should look at this and determine that it is the

month of Jan 06. I created the formula below:

Code:
--------------------

if(day(eomonth(startcycleday,0)-day(startcycleday)day(endcycleday),month(s*tartcy cle),month(endcycle))

--------------------

now the problem I faced, a flaw in this formula is suppose I have a
cycle starting 11/30/2005 and ending on 1/1/2006, the logic above will
look at this and determine that it is the month of january 2006 however

this is not true, it should be the month of december. also say the
number of days in the start date and the numbers of days in the end
date are equal, the logic will probably choose whichever month.

my head has been spinning for the last few months.

any help would be greatly appreciated.

#2
Posted to microsoft.public.excel.programming
 external usenet poster Posts: 1
A formula or macro that determine the correct month

Hello leitek.com,

Try this method...

Days = EndingDate - StartingDate
MonthEnd = StartingDate + (Days/2)

Sincerely,
Leith Ross

--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465

#3
Posted to microsoft.public.excel.programming
 external usenet poster Posts: 7
A formula or macro that determine the correct month

Hi Leith,

into formula.

any further insight would be much appreciated.

thanks,
salah

Leith Ross wrote:
Hello leitek.com,

Try this method...

Days = EndingDate - StartingDate
MonthEnd = StartingDate + (Days/2)

Sincerely,
Leith Ross

--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465

 Posting Rules Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On

 Similar Threads Thread Thread Starter Forum Replies Last Post Robert R Excel Worksheet Functions 6 April 24th 23 09:00 PM Chuck M Excel Worksheet Functions 4 July 5th 07 09:34 PM Eric Excel Discussion (Misc queries) 5 March 8th 07 12:04 AM Eric Excel Worksheet Functions 1 March 7th 07 04:00 PM salooha Excel Discussion (Misc queries) 0 February 9th 06 09:18 PM

All times are GMT +1. The time now is 09:39 PM.