ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   sum a specific range (https://www.excelbanter.com/excel-discussion-misc-queries/211718-sum-specific-range.html)

darkfeld

sum a specific range
 
I am working in Microsoft Excel 2003. I am trying to sum certain ranges in
multiple lines of data. An example of my spreadsheet is below. The way it
is now, the "END BALANCE" row is not including the amount in the CDU field
(row 1 and 8). I need to be able to sum rows 1-5 with results on row 6 and
then sum rows 8-14 with results on row 15, etc. Any ideas?

A B C
1 NAME CDU 3.42
2 INCOME 1.31
3 BOND 1.29
4 BALANCED 5.42
5 LARGE-CAP 3.05
6 END BALANCE 11.07
7 0
8 NAME CDU 5.42
9 INCOME 6.31
10 BOND 18.29
11 BALANCED 53.42
12 LARGE-CAP 35.05
13 MID-CAP 2.00
14 WORLD 5.00
15 END BALANCE 120.07


TomPl

sum a specific range
 
I may have misunderstood your question but it should be as simple as entering
the following formulas:

Enter the formula =sum(C2:C5) in cell C6
Enter the formula =sum(C9:C14) in cell C15

Tom

darkfeld

sum a specific range
 
I wish it was just that easy. My spreadsheet is about 10,000 rows and I was
searching for one formula that I could use.

"TomPl" wrote:

I may have misunderstood your question but it should be as simple as entering
the following formulas:

Enter the formula =sum(C2:C5) in cell C6
Enter the formula =sum(C9:C14) in cell C15

Tom


TomPl

sum a specific range
 
I guess you wanted to include the CDU row so change the formulas to:

Enter the formula =sum(C1:C5) in cell C6
Enter the formula =sum(C8:C14) in cell C15

Tom

darkfeld

sum a specific range
 
I have about 10,000 rows of data. Will I have to do that manually? I just
need to somehow name the range between the CDU# and the line before the END
BALANCE #.

"TomPl" wrote:

I guess you wanted to include the CDU row so change the formulas to:

Enter the formula =sum(C1:C5) in cell C6
Enter the formula =sum(C8:C14) in cell C15

Tom


muddan madhu

sum a specific range
 
try this

Keep Row 1 blank

in D2 put this formula and drag it down =IF(A3=0,(SUM($C$2:C2)-SUM($D
$1:D1)),"")



On Nov 26, 10:46*pm, darkfeld
wrote:
I am working in Microsoft Excel 2003. *I am trying to sum certain ranges in
multiple lines of data. *An example of my spreadsheet is below. *The way it
is now, the "END BALANCE" row is not including the amount in the CDU field
(row 1 and 8). *I need to be able to sum rows 1-5 with results on row 6 and
then sum rows 8-14 with results on row 15, etc. *Any ideas?

* * * * A * * * * * * * B * * * * * * * C
1 *NAME * * * * CDU * * * * * * 3.42
2 *INCOME * * * * * * * * * * * * * * * 1..31
3 *BOND * * * * * * * * * * * * 1.29
4 *BALANCED * * * * * * * * * * 5.42
5 *LARGE-CAP * * * * * * * * * *3.05
6 *END BALANCE * * * * * * * * *11.07
7 *0
8 *NAME * * * * CDU * * * * * * 5.42
9 *INCOME * * * * * * * * * * * * * * * 6..31
10 BOND * * * * * * * * * * * * 18.29
11 BALANCED * * * * * * * * * * 53.42
12 LARGE-CAP * * * * * * * * * *35.05
13 MID-CAP * * * * * * * * * * *2.00
14 WORLD * * * * * * * * * * * * * * * *5..00
15 END BALANCE * * * * * * * * *120.07



TomPl

sum a specific range
 
You could paste this macro into a module in your workbook, make sure the
spreadsheet in question is active then run this macro. I think it is what
you want.

Tom

Sub InsertTotals()

Dim dblStart As Double
Dim dblCounter As Double

For dblCounter = 1 To ActiveSheet.UsedRange _
..Rows(ActiveSheet.UsedRange.Rows.Count).Row
If ActiveSheet.Cells(dblCounter, 1).Value = "NAME" Then
dblStart = dblCounter
End If
If ActiveSheet.Cells(dblCounter, 1).Value = "END BALANCE" Then
ActiveSheet.Cells(dblCounter, 3).Value = _
"=sum(C" & dblStart & ":c" & dblCounter - 1 & ")"
End If
Next dblCounter

End Sub

Hardeep_kanwar[_2_]

sum a specific range
 
Could you pls provide the example sheet with 45-50
Is there only one blank row or more with in range?

For Ex: A B C
1 DATA 240
2 DATA 250
3 DATA300
4 BLANK
5 DATA 600
6 DATA 700
7 BLANK
8 DATA 400
9 DATA 500
10 DATA 300
11 DATA 800
12 BLANK


If there is one blank row then its very simple without using macro or
coding and or even without Complicated Formulas.

Regards

Hardeep kanwar

"darkfeld" wrote:

I have about 10,000 rows of data. Will I have to do that manually? I just
need to somehow name the range between the CDU# and the line before the END
BALANCE #.

"TomPl" wrote:

I guess you wanted to include the CDU row so change the formulas to:

Enter the formula =sum(C1:C5) in cell C6
Enter the formula =sum(C8:C14) in cell C15

Tom



All times are GMT +1. The time now is 08:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com