Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How can I automatically split values over specified time periods?

Hi, I monitor the energy usage for my organisation and report quarterly. As
you will be aware, utility bills do not always come in nice and neat
quarterly or monthly invoicing periods and I would really benefit from a way
of automatically splitting amounts entered into quarters. e.g

I enter 25 Dec 07 to 04 Feb 08 = 1000 kwh

Rather than manually dividing myself, can I allocate 5 days usage to the Oct
to Dec quarter and the rest to the Jan to Mar quarter?

Any help would be greatly appreciated :)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 523
Default How can I automatically split values over specified time periods?

Hi,

I had to do something similar, this was the fastest technique:

Let A & B be your quarter start and end date, X & Y the period covered on
the electricity bill. You want to work out the overlap between these two
periods (you can do the same for the next quarter after AB etc)

The biggest the overlap can be is: A+1-B days (if A and B are the same it's
1 day, hence the +1) So, so far =(A+1-B)

If the bill period ends before the quarter period then you need to knock
theses days off. This is Max(B-Y,0), so we have =(A+1-B) - Max(B-Y,0)

If the bill period starts after the quarter period then you need to knock
these days off, this is Max(X-A,0)... This gives
=(A+1-B)-Max(B-Y,0)-Max(X-A,0)


As a final point, the whole lot must be at least 0 days, so this must be the
final formula:

=Max((A+1-B)-Max(B-Y,0)-Max(X-A,0),0)

I hope that makes sense...

"Grushenka" wrote:

Hi, I monitor the energy usage for my organisation and report quarterly. As
you will be aware, utility bills do not always come in nice and neat
quarterly or monthly invoicing periods and I would really benefit from a way
of automatically splitting amounts entered into quarters. e.g

I enter 25 Dec 07 to 04 Feb 08 = 1000 kwh

Rather than manually dividing myself, can I allocate 5 days usage to the Oct
to Dec quarter and the rest to the Jan to Mar quarter?

Any help would be greatly appreciated :)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How can I automatically split values over specified time perio

Thanks Sam! :)

"Sam Wilson" wrote:

Hi,

I had to do something similar, this was the fastest technique:

Let A & B be your quarter start and end date, X & Y the period covered on
the electricity bill. You want to work out the overlap between these two
periods (you can do the same for the next quarter after AB etc)

The biggest the overlap can be is: A+1-B days (if A and B are the same it's
1 day, hence the +1) So, so far =(A+1-B)

If the bill period ends before the quarter period then you need to knock
theses days off. This is Max(B-Y,0), so we have =(A+1-B) - Max(B-Y,0)

If the bill period starts after the quarter period then you need to knock
these days off, this is Max(X-A,0)... This gives
=(A+1-B)-Max(B-Y,0)-Max(X-A,0)


As a final point, the whole lot must be at least 0 days, so this must be the
final formula:

=Max((A+1-B)-Max(B-Y,0)-Max(X-A,0),0)

I hope that makes sense...

"Grushenka" wrote:

Hi, I monitor the energy usage for my organisation and report quarterly. As
you will be aware, utility bills do not always come in nice and neat
quarterly or monthly invoicing periods and I would really benefit from a way
of automatically splitting amounts entered into quarters. e.g

I enter 25 Dec 07 to 04 Feb 08 = 1000 kwh

Rather than manually dividing myself, can I allocate 5 days usage to the Oct
to Dec quarter and the rest to the Jan to Mar quarter?

Any help would be greatly appreciated :)

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
Possible to create line chart with values not in all time periods? CodeKid Charts and Charting in Excel 1 December 1st 06 01:51 AM
periods of time Ben New Users to Excel 1 March 5th 06 07:47 PM
calculate time periods umba-sr Excel Worksheet Functions 1 February 21st 06 02:13 PM
No. of days split into periods Brian Ferris Excel Discussion (Misc queries) 3 January 31st 06 03:29 PM
periods of time in excel orlando barreto Excel Programming 1 September 30th 03 11:00 AM


All times are GMT +1. The time now is 10:26 AM.

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

About Us

"It's about Microsoft Excel"