Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 130
Default calculating subtotals for sequential blank cells in 1 column

if i had a column of data and i need to group/subtotal any cells containing
zeros or isolated zeros, wat formula do i put in
eg.

0 )
1 )
0 )
0 ) subtotal = 4 (so i know it was a group of four cells)
4
5
1
6
5
0 )
1 )
0 ) subtotal = 3
6
7
8
0 ) subtotal = 1

basically the data shows steps and rests, and we need to know how long the
rest periods are. single steps surrounded by rest (0) need to be counted as
rest intervals.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,069
Default calculating subtotals for sequential blank cells in 1 column

Here is one way. Assuming your data starts in A1...

In B1 enter =--(A1=0)
In B2 enter =IF(A2=0,B1+1,IF(AND(A1=0,A3=0),B1+1,0))
Copy B2 down through all rows of data.

In C1 enter =IF(AND(B2=0,B1<0),"subtotal = "&B1,"")
Copy C1 down through all rows of data.
Add a non-zero dummy number (99999) after the last data cell in column A (no
formulas in B or C next to the dummy number; it just ensures that the last
data cell in A gets handled correctly by the formulas in B & C).
Hide column B if desired.

Hope this helps,

Hutch

"Katie" wrote:

if i had a column of data and i need to group/subtotal any cells containing
zeros or isolated zeros, wat formula do i put in
eg.

0 )
1 )
0 )
0 ) subtotal = 4 (so i know it was a group of four cells)
4
5
1
6
5
0 )
1 )
0 ) subtotal = 3
6
7
8
0 ) subtotal = 1

basically the data shows steps and rests, and we need to know how long the
rest periods are. single steps surrounded by rest (0) need to be counted as
rest intervals.


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
calculating date/time with blank cells ferde Excel Discussion (Misc queries) 2 August 23rd 07 11:26 PM
Sequential numbering with Subtotals charris0517 Excel Worksheet Functions 3 January 28th 07 10:22 PM
How to skip the blank cells for calculating StdDev? Eric Excel Worksheet Functions 3 November 7th 06 12:00 AM
How to skip the blank cells for calculating StdDev? Eric Excel Worksheet Functions 3 November 6th 06 07:38 AM
calculating average with blank cells marvinks Excel Worksheet Functions 3 August 7th 06 04:34 PM


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