Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 122
Default sum up values at intervals

Hello!
What formula can I use in Col C in the example table below:
Row# Col A Col B Col C
1 X 1 1
2 Y 2 2
3 Y 1 3
4 X 1 1
5 X 1 2

Col C sums up the values in Col B based on Col A:
A1 = X therefore C1 sums B1:B1 to get "1"
A2 = Y therefore C2 sums B2:B2 to get "2"
A3 = Y. Since the row above is also "Y", C3 should sum B2:B3 to get "3"
A4 = X. Since this "breaks" the series of "Y", C4 should restart the
summing from this row, i.e. B4:B4 to get "1"
A5 = X. Since the row above is also "X", C5 should sum C4:C5 to get "2"
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default sum up values at intervals

Melissa,

Put this in C1
=B1
and this in C2
=IF(A2=A1,B2+C1,B2)

Drag C2 down as fae as required.

Mike
"Melissa" wrote:

Hello!
What formula can I use in Col C in the example table below:
Row# Col A Col B Col C
1 X 1 1
2 Y 2 2
3 Y 1 3
4 X 1 1
5 X 1 2

Col C sums up the values in Col B based on Col A:
A1 = X therefore C1 sums B1:B1 to get "1"
A2 = Y therefore C2 sums B2:B2 to get "2"
A3 = Y. Since the row above is also "Y", C3 should sum B2:B3 to get "3"
A4 = X. Since this "breaks" the series of "Y", C4 should restart the
summing from this row, i.e. B4:B4 to get "1"
A5 = X. Since the row above is also "X", C5 should sum C4:C5 to get "2"

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
Plotting average values against time intervals PierreL Charts and Charting in Excel 8 June 12th 07 06:24 PM
Count Intervals of 2 Consecutive Values in same Row and Return Count across Row Sam via OfficeKB.com Excel Worksheet Functions 6 November 29th 05 03:27 PM
assigning values by intervals Pete at FMR Excel Worksheet Functions 2 August 8th 05 03:55 PM
Count Intervals of Filtered TEXT values in Column and Return Count across a Row Sam via OfficeKB.com Excel Worksheet Functions 9 July 31st 05 03:37 AM
Adding values for prior date intervals Qaspec Excel Worksheet Functions 0 January 25th 05 01:49 AM


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