Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default summing adjacent data in a worksheet

I have a column of data and I need to sum the values in adjacent cells when
they are bounded before and after by cells that contain a value of 0. Then I
need to sum the next group of cells bounded by zeros. So I want a column with
subtotals rather than one total. The number of cells in one group may vary.
I've tried using the sumif function, but what I want doesn't seem to quite
fit.

I'm using Excel 2007.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default summing adjacent data in a worksheet

So, you have something like this:

1
2
3
0
4
5
6
7
0
0
8
9
0
10
11
12
13
0
0

and you want to get something like this:

1
2
3 6
0
4
5
6
7 22
0
0
8
9 17
0
10
11
12
13 46
0
0

Well, I put that sample data in column L starting with L2, and then
put this formula in M2:

=IF(AND(L3=0,L2<0),SUM(L$1:L2)-SUM(M$1:M1),"")

and just copied it down to get the above result.

Hope this helps.

Pete


On Nov 26, 10:15*pm, Suzie wrote:
I have a column of data and I need to sum the values in adjacent cells when
they are bounded before and after by cells that contain a value of 0. Then I
need to sum the next group of cells bounded by zeros. So I want a column with
subtotals rather than one total. The number of cells in one group may vary.
I've tried using the sumif function, but what I want doesn't seem to quite
fit.

I'm using Excel 2007.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default summing adjacent data in a worksheet

Thanks a lot. That works well.
Cheers,
Suzie

"Pete_UK" wrote:

So, you have something like this:

1
2
3
0
4
5
6
7
0
0
8
9
0
10
11
12
13
0
0

and you want to get something like this:

1
2
3 6
0
4
5
6
7 22
0
0
8
9 17
0
10
11
12
13 46
0
0

Well, I put that sample data in column L starting with L2, and then
put this formula in M2:

=IF(AND(L3=0,L2<0),SUM(L$1:L2)-SUM(M$1:M1),"")

and just copied it down to get the above result.

Hope this helps.

Pete


On Nov 26, 10:15 pm, Suzie wrote:
I have a column of data and I need to sum the values in adjacent cells when
they are bounded before and after by cells that contain a value of 0. Then I
need to sum the next group of cells bounded by zeros. So I want a column with
subtotals rather than one total. The number of cells in one group may vary.
I've tried using the sumif function, but what I want doesn't seem to quite
fit.

I'm using Excel 2007.


.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default summing adjacent data in a worksheet

You're welcome, Suzie - thanks for feeding back.

Pete

On Nov 30, 10:46*pm, Suzie wrote:
Thanks a lot. That works well.
Cheers,
Suzie



"Pete_UK" wrote:
So, you have something like this:


1
2
3
0
4
5
6
7
0
0
8
9
0
10
11
12
13
0
0


and you want to get something like this:


1
2
3 * * * 6
0
4
5
6
7 * * *22
0
0
8
9 * * * 17
0
10
11
12
13 * * *46
0
0


Well, I put that sample data in column L starting with L2, and then
put this formula in M2:


=IF(AND(L3=0,L2<0),SUM(L$1:L2)-SUM(M$1:M1),"")


and just copied it down to get the above result.


Hope this helps.


Pete


On Nov 26, 10:15 pm, Suzie wrote:
I have a column of data and I need to sum the values in adjacent cells when
they are bounded before and after by cells that contain a value of 0. Then I
need to sum the next group of cells bounded by zeros. So I want a column with
subtotals rather than one total. The number of cells in one group may vary.
I've tried using the sumif function, but what I want doesn't seem to quite
fit.


I'm using Excel 2007.


.- Hide quoted text -


- Show quoted text -


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
Summing +30 Non-adjacent cells Stacy C[_2_] Excel Worksheet Functions 5 July 26th 09 05:46 PM
conditional summing of data from another worksheet Tom Excel Worksheet Functions 5 November 6th 07 10:49 PM
When data match, copy adjacent value to adjacent column slimbim Excel Worksheet Functions 2 November 8th 06 08:41 PM
summing values from adjacent column with refrence from adjacent column Pivotrend Excel Discussion (Misc queries) 6 March 4th 06 11:24 AM
Lookup value throughout an array_return adjacent value and summing SP Excel Worksheet Functions 3 August 26th 05 09:24 PM


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