Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 390
Default Cumulative sum with a ceiling

Hello,
I need help please, with a formula which calculates the cumulative sum of a
column of distances in kilometers.
When the cumulative total reaches a celing of 350kms, it must restart the
cumlulative total again.
If any distance is greater than 350kms then it must give the cumulative
total excluding the greater value, and highlight the cell, show the greater
value in a seperate column and restart the cumulative count again.

My opbjective is to plan a travel route over 5000kms and a scheduled stop
every 350kms for the night. This is to plan where I will be stopping over to
make the booking in advance.

Thank you for your help.

Max
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Cumulative sum with a ceiling

See if this helps.

Assume the distances are in the range A1:A20

Enter this formula in B1:

=A1

Enter this formula in B2 and copy down to B20:

=IF(SUM(B1,A2)<=350,SUM(B1,A2),A2)

Now, highlight the cells in column A where the sum resets.

Select the range A2:A20
Goto FormatConditional Formatting
Formula Is: =A2=B2
Click the Format button
Select the style(s) desired
OK out

Biff

"Max" wrote in message
...
Hello,
I need help please, with a formula which calculates the cumulative sum of
a
column of distances in kilometers.
When the cumulative total reaches a celing of 350kms, it must restart the
cumlulative total again.
If any distance is greater than 350kms then it must give the cumulative
total excluding the greater value, and highlight the cell, show the
greater
value in a seperate column and restart the cumulative count again.

My opbjective is to plan a travel route over 5000kms and a scheduled stop
every 350kms for the night. This is to plan where I will be stopping over
to
make the booking in advance.

Thank you for your help.

Max



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 174
Default Cumulative sum with a ceiling

Perhaps you could do something like this...

Assuming your column of distances starts at A2 then in B2 use this formula

=SUM(A$2:A2)-SUMIF(B$1:B1,"=350")

and in C2

=IF(B2=350,B2,"")

copy both formulas down as far as necessary

then

use conditional formatting on column B using

"cell value is" "greater than or equal to" 350

then

setting font and pattern to the same colour, e.g. red




"Max" wrote:

Hello,
I need help please, with a formula which calculates the cumulative sum of a
column of distances in kilometers.
When the cumulative total reaches a celing of 350kms, it must restart the
cumlulative total again.
If any distance is greater than 350kms then it must give the cumulative
total excluding the greater value, and highlight the cell, show the greater
value in a seperate column and restart the cumulative count again.

My opbjective is to plan a travel route over 5000kms and a scheduled stop
every 350kms for the night. This is to plan where I will be stopping over to
make the booking in advance.

Thank you for your help.

Max

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,345
Default Cumulative sum with a ceiling

Max" wrote in message
... Hello,
I need help please, with a formula


I can't help with a formula but wold a Macro do?

Sub AddIt()
Dim EndRow As Long
Dim n As Long
Dim Tot As Double
Dim x As Long
Dim s As Long

EndRow = Cells(Rows.Count, 6).End(xlUp).Row

Range("G:G").ClearContents

n = 0
'Set s to Start Row of your data
s = 10

Tot = 0

For x = s To EndRow
If Tot + Cells(x, 6).Value <= 350 Then
Tot = Tot + Cells(x, 6).Value
Else: Cells(x - n, 7).Value = Tot
Tot = Cells(x, 6).Value
End If
n = 1
Next x

End Sub

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Max" wrote in message
...
Hello,
I need help please, with a formula which calculates the cumulative sum of
a
column of distances in kilometers.
When the cumulative total reaches a celing of 350kms, it must restart the
cumlulative total again.
If any distance is greater than 350kms then it must give the cumulative
total excluding the greater value, and highlight the cell, show the
greater
value in a seperate column and restart the cumulative count again.

My opbjective is to plan a travel route over 5000kms and a scheduled stop
every 350kms for the night. This is to plan where I will be stopping over
to
make the booking in advance.

Thank you for your help.

Max





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 947
Default Cumulative sum with a ceiling

My objective is to plan a travel route over 5000kms and a scheduled stop
every 350kms for the night.


May I suggest an alternative if your travel is in the USA?
I would recommend mapping software, such as "Street Atlas 2007." from
DeLorme ( http://www.delorme.com )
Microsoft also has a similar product, but I've not used it. (
http://www.microsoft.com/streets/default.mspx )
You can tell such programs you would like to drive 350km per day, and it
will plan all your stops on the map.
You can also give your car's gas mileage, etc, and it will plan gas stops as
well.
Your map will display all the planned stops.
Right click the area of the map where you plan to spend the night, and it
will pull up all hotels in the area, complete with address/phone numbers.
Again, just an idea.

--
HTH :)
Dana DeLouis
Windows XP & Office 2003


"Max" wrote in message
...
Hello,
I need help please, with a formula which calculates the cumulative sum of
a
column of distances in kilometers.
When the cumulative total reaches a celing of 350kms, it must restart the
cumlulative total again.
If any distance is greater than 350kms then it must give the cumulative
total excluding the greater value, and highlight the cell, show the
greater
value in a seperate column and restart the cumulative count again.

My opbjective is to plan a travel route over 5000kms and a scheduled stop
every 350kms for the night. This is to plan where I will be stopping over
to
make the booking in advance.

Thank you for your help.

Max



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7,247
Default Cumulative sum with a ceiling

Microsoft also has a similar product, but I've not used it. (

MapPoint will do all that and more. One of the more intriguing features of
MapPoint is that it connects to the internet and downloads (from where I
don't know) road construction info, alerting you to the fact that a
particular highway may have construction delays. It allows you to assign
speeds to different road types (e.g., 70 mph for Interstates and 30 for side
streets), and will compute travel time based on which type of roads you'll
be driving on. MapPoint is one of favorite Office programs.



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"Dana DeLouis" wrote in message
...
My objective is to plan a travel route over 5000kms and a scheduled stop
every 350kms for the night.


May I suggest an alternative if your travel is in the USA?
I would recommend mapping software, such as "Street Atlas 2007." from
DeLorme ( http://www.delorme.com )
Microsoft also has a similar product, but I've not used it. (
http://www.microsoft.com/streets/default.mspx )
You can tell such programs you would like to drive 350km per day, and it
will plan all your stops on the map.
You can also give your car's gas mileage, etc, and it will plan gas stops
as well.
Your map will display all the planned stops.
Right click the area of the map where you plan to spend the night, and it
will pull up all hotels in the area, complete with address/phone numbers.
Again, just an idea.

--
HTH :)
Dana DeLouis
Windows XP & Office 2003


"Max" wrote in message
...
Hello,
I need help please, with a formula which calculates the cumulative sum of
a
column of distances in kilometers.
When the cumulative total reaches a celing of 350kms, it must restart the
cumlulative total again.
If any distance is greater than 350kms then it must give the cumulative
total excluding the greater value, and highlight the cell, show the
greater
value in a seperate column and restart the cumulative count again.

My opbjective is to plan a travel route over 5000kms and a scheduled stop
every 350kms for the night. This is to plan where I will be stopping over
to
make the booking in advance.

Thank you for your help.

Max





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
help! cumulative returns blapatrick Excel Worksheet Functions 3 June 28th 06 01:48 AM
How do I do a cumulative frequency graph? ted Charts and Charting in Excel 2 May 4th 06 12:46 AM
Line graph for cumulative number over time Jane Charts and Charting in Excel 0 April 9th 06 07:19 AM
Formula Help for Cumulative Result Paul Sheppard Excel Discussion (Misc queries) 5 January 26th 06 10:37 AM
Cumulative Summing Carpie Excel Discussion (Misc queries) 3 February 11th 05 04:35 PM


All times are GMT +1. The time now is 03:30 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"