#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 130
Default Subtotaling

I need a formula to subtotal each set of 1's in a column, without subtotaling
other numbers in the column.
example shown below.

1 )
1 ) subtotal = 2
2 ]
5 ]
6 ]
7 ] no subtotal
1 )
1 )
1 )
1 )
1 )
1 ) subtotal = 6
5 ]
6 ]
7 ]
6 ]
5 ] no subtotal
1 ) subtotal = 1
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 269
Default Subtotaling


A B
1 =IF(AND(A1=1,A2<1),1,"")
1 =IF(AND(A2=1,A3<1),COUNTIF($A$1:$A2,1)-SUM($B$1:$B1),"")
2 =IF(AND(A3=1,A4<1),COUNTIF($A$1:$A3,1)-SUM($B$1:$B2),"")
5 =IF(AND(A4=1,A5<1),COUNTIF($A$1:$A4,1)-SUM($B$1:$B3),"")
6 =IF(AND(A5=1,A6<1),COUNTIF($A$1:$A5,1)-SUM($B$1:$B4),"")
7 =IF(AND(A6=1,A7<1),COUNTIF($A$1:$A6,1)-SUM($B$1:$B5),"")
1 =IF(AND(A7=1,A8<1),COUNTIF($A$1:$A7,1)-SUM($B$1:$B6),"")
1 =IF(AND(A8=1,A9<1),COUNTIF($A$1:$A8,1)-SUM($B$1:$B7),"")
1 =IF(AND(A9=1,A10<1),COUNTIF($A$1:$A9,1)-SUM($B$1:$B8),"")
1 =IF(AND(A10=1,A11<1),COUNTIF($A$1:$A10,1)-SUM($B$1:$B9),"")
1 =IF(AND(A11=1,A12<1),COUNTIF($A$1:$A11,1)-SUM($B$1:$B10),"")
1 =IF(AND(A12=1,A13<1),COUNTIF($A$1:$A12,1)-SUM($B$1:$B11),"")
5 =IF(AND(A13=1,A14<1),COUNTIF($A$1:$A13,1)-SUM($B$1:$B12),"")
6 =IF(AND(A14=1,A15<1),COUNTIF($A$1:$A14,1)-SUM($B$1:$B13),"")
7 =IF(AND(A15=1,A16<1),COUNTIF($A$1:$A15,1)-SUM($B$1:$B14),"")
6 =IF(AND(A16=1,A17<1),COUNTIF($A$1:$A16,1)-SUM($B$1:$B15),"")
5 =IF(AND(A17=1,A18<1),COUNTIF($A$1:$A17,1)-SUM($B$1:$B16),"")
1 =IF(AND(A18=1,A19<1),COUNTIF($A$1:$A18,1)-SUM($B$1:$B17),"")

B1 is a unique formula being the first cell. The formula in B2 can be
copied down.
-- .
If this helps, please remember to click yes.


"Katie" wrote:

I need a formula to subtotal each set of 1's in a column, without subtotaling
other numbers in the column.
example shown below.

1 )
1 ) subtotal = 2
2 ]
5 ]
6 ]
7 ] no subtotal
1 )
1 )
1 )
1 )
1 )
1 ) subtotal = 6
5 ]
6 ]
7 ]
6 ]
5 ] no subtotal
1 ) subtotal = 1

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 130
Default Subtotaling

i ended up with a column that looked like this
0












1










0



0


0

not quite wat i had in mind..

--------------
"Paul C" wrote:


A B
1 =IF(AND(A1=1,A2<1),1,"")
1 =IF(AND(A2=1,A3<1),COUNTIF($A$1:$A2,1)-SUM($B$1:$B1),"")
2 =IF(AND(A3=1,A4<1),COUNTIF($A$1:$A3,1)-SUM($B$1:$B2),"")
5 =IF(AND(A4=1,A5<1),COUNTIF($A$1:$A4,1)-SUM($B$1:$B3),"")
6 =IF(AND(A5=1,A6<1),COUNTIF($A$1:$A5,1)-SUM($B$1:$B4),"")
7 =IF(AND(A6=1,A7<1),COUNTIF($A$1:$A6,1)-SUM($B$1:$B5),"")
1 =IF(AND(A7=1,A8<1),COUNTIF($A$1:$A7,1)-SUM($B$1:$B6),"")
1 =IF(AND(A8=1,A9<1),COUNTIF($A$1:$A8,1)-SUM($B$1:$B7),"")
1 =IF(AND(A9=1,A10<1),COUNTIF($A$1:$A9,1)-SUM($B$1:$B8),"")
1 =IF(AND(A10=1,A11<1),COUNTIF($A$1:$A10,1)-SUM($B$1:$B9),"")
1 =IF(AND(A11=1,A12<1),COUNTIF($A$1:$A11,1)-SUM($B$1:$B10),"")
1 =IF(AND(A12=1,A13<1),COUNTIF($A$1:$A12,1)-SUM($B$1:$B11),"")
5 =IF(AND(A13=1,A14<1),COUNTIF($A$1:$A13,1)-SUM($B$1:$B12),"")
6 =IF(AND(A14=1,A15<1),COUNTIF($A$1:$A14,1)-SUM($B$1:$B13),"")
7 =IF(AND(A15=1,A16<1),COUNTIF($A$1:$A15,1)-SUM($B$1:$B14),"")
6 =IF(AND(A16=1,A17<1),COUNTIF($A$1:$A16,1)-SUM($B$1:$B15),"")
5 =IF(AND(A17=1,A18<1),COUNTIF($A$1:$A17,1)-SUM($B$1:$B16),"")
1 =IF(AND(A18=1,A19<1),COUNTIF($A$1:$A18,1)-SUM($B$1:$B17),"")

B1 is a unique formula being the first cell. The formula in B2 can be
copied down.
-- .
If this helps, please remember to click yes.


"Katie" wrote:

I need a formula to subtotal each set of 1's in a column, without subtotaling
other numbers in the column.
example shown below.

1 )
1 ) subtotal = 2
2 ]
5 ]
6 ]
7 ] no subtotal
1 )
1 )
1 )
1 )
1 )
1 ) subtotal = 6
5 ]
6 ]
7 ]
6 ]
5 ] no subtotal
1 ) subtotal = 1

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 269
Default Subtotaling

my results look like this
A B
1 Row 1
1 2 Row 2
2 Row 3
5 Row 4
6 Row 5
7 Row 6
1 Row 7
1 Row 8
1 Row 9
1 Row 10
1 Row 11
1 6 Row 12
5 Row 13
6 Row 14
7 Row 15
6 Row 16
5 Row 17
1 1 Row 18

Double check the formula in B2.
=IF(AND(A2=1,A3<1),COUNTIF($A$1:$A2,1)-SUM($B$1:$B1),"")

Tthe absolute reference indicators ($) are critical to make the formula work
when you copy down. One missing or extra $ will change the results
--
If this helps, please remember to click yes.


"Katie" wrote:

i ended up with a column that looked like this
0












1










0



0


0

not quite wat i had in mind..

--------------
"Paul C" wrote:


A B
1 =IF(AND(A1=1,A2<1),1,"")
1 =IF(AND(A2=1,A3<1),COUNTIF($A$1:$A2,1)-SUM($B$1:$B1),"")
2 =IF(AND(A3=1,A4<1),COUNTIF($A$1:$A3,1)-SUM($B$1:$B2),"")
5 =IF(AND(A4=1,A5<1),COUNTIF($A$1:$A4,1)-SUM($B$1:$B3),"")
6 =IF(AND(A5=1,A6<1),COUNTIF($A$1:$A5,1)-SUM($B$1:$B4),"")
7 =IF(AND(A6=1,A7<1),COUNTIF($A$1:$A6,1)-SUM($B$1:$B5),"")
1 =IF(AND(A7=1,A8<1),COUNTIF($A$1:$A7,1)-SUM($B$1:$B6),"")
1 =IF(AND(A8=1,A9<1),COUNTIF($A$1:$A8,1)-SUM($B$1:$B7),"")
1 =IF(AND(A9=1,A10<1),COUNTIF($A$1:$A9,1)-SUM($B$1:$B8),"")
1 =IF(AND(A10=1,A11<1),COUNTIF($A$1:$A10,1)-SUM($B$1:$B9),"")
1 =IF(AND(A11=1,A12<1),COUNTIF($A$1:$A11,1)-SUM($B$1:$B10),"")
1 =IF(AND(A12=1,A13<1),COUNTIF($A$1:$A12,1)-SUM($B$1:$B11),"")
5 =IF(AND(A13=1,A14<1),COUNTIF($A$1:$A13,1)-SUM($B$1:$B12),"")
6 =IF(AND(A14=1,A15<1),COUNTIF($A$1:$A14,1)-SUM($B$1:$B13),"")
7 =IF(AND(A15=1,A16<1),COUNTIF($A$1:$A15,1)-SUM($B$1:$B14),"")
6 =IF(AND(A16=1,A17<1),COUNTIF($A$1:$A16,1)-SUM($B$1:$B15),"")
5 =IF(AND(A17=1,A18<1),COUNTIF($A$1:$A17,1)-SUM($B$1:$B16),"")
1 =IF(AND(A18=1,A19<1),COUNTIF($A$1:$A18,1)-SUM($B$1:$B17),"")

B1 is a unique formula being the first cell. The formula in B2 can be
copied down.
-- .
If this helps, please remember to click yes.


"Katie" wrote:

I need a formula to subtotal each set of 1's in a column, without subtotaling
other numbers in the column.
example shown below.

1 )
1 ) subtotal = 2
2 ]
5 ]
6 ]
7 ] no subtotal
1 )
1 )
1 )
1 )
1 )
1 ) subtotal = 6
5 ]
6 ]
7 ]
6 ]
5 ] no subtotal
1 ) subtotal = 1

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
Subtotaling Katie Excel Worksheet Functions 1 December 11th 09 03:10 AM
Subtotaling falva Excel Worksheet Functions 0 February 20th 09 05:01 PM
Display when subtotaling. Bookmdano Excel Discussion (Misc queries) 2 August 11th 08 05:02 PM
subtotaling Mike Morris Excel Discussion (Misc queries) 2 March 27th 08 10:01 PM
subtotaling every third row? [email protected] Excel Worksheet Functions 4 May 4th 07 11:44 PM


All times are GMT +1. The time now is 11:34 PM.

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"