sum a specific range

D

darkfeld

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
 
T

TomPl

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
 
D

darkfeld

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.
 
T

TomPl

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
 
D

darkfeld

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 #.
 
M

muddan madhu

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)),"")
 
T

TomPl

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
 
H

Hardeep_kanwar

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 it’s very simple without using macro or
coding and or even without Complicated Formulas.

Regards

Hardeep kanwar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top