Autosum Formula Question

mojo300

Active Member
Joined
Apr 18, 2006
Messages
301
Is there a formula that can give me the autosum underneath the way I have it shown in columns D & E?




<b>Excel 2002</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="text-align: center;;">8,092.47 </td><td style="text-align: center;;">5,807.53 </td><td style="text-align: right;;"></td><td style="text-align: center;;">8,092.47 </td><td style="text-align: center;;">5,807.53 </td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: center;;">11,233.76 </td><td style="text-align: center;;">8,566.24 </td><td style="text-align: right;;"></td><td style="text-align: center;;">11,233.76 </td><td style="text-align: center;;">8,566.24 </td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: center;;">11,233.76 </td><td style="text-align: center;;">8,566.24 </td><td style="text-align: right;;"></td><td style="text-align: center;;">11,233.76 </td><td style="text-align: center;;">8,566.24 </td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="font-weight: bold;text-align: center;;">30,559.99 </td><td style="font-weight: bold;text-align: center;;">22,940.01 </td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style="text-align: center;;">9,574.23 </td><td style="text-align: center;;">7,300.77 </td><td style="text-align: right;;"></td><td style="text-align: center;;">9,574.23 </td><td style="text-align: center;;">7,300.77 </td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style="text-align: center;;">11,233.76 </td><td style="text-align: center;;">8,566.24 </td><td style="text-align: right;;"></td><td style="text-align: center;;">11,233.76 </td><td style="text-align: center;;">8,566.24 </td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style="text-align: center;;">13,358.78 </td><td style="text-align: center;;">11,641.22 </td><td style="text-align: right;;"></td><td style="text-align: center;;">13,358.78 </td><td style="text-align: center;;">11,641.22 </td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style="text-align: center;;">13,358.78 </td><td style="text-align: center;;">11,641.22 </td><td style="text-align: right;;"></td><td style="text-align: center;;">13,358.78 </td><td style="text-align: center;;">11,641.22 </td></tr><tr ><td style="color: #161120;text-align: center;">10</td><td style="text-align: center;;">5,049.71 </td><td style="text-align: center;;">2,800.29 </td><td style="text-align: right;;"></td><td style="text-align: center;;">5,049.71 </td><td style="text-align: center;;">2,800.29 </td></tr><tr ><td style="color: #161120;text-align: center;">11</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="font-weight: bold;text-align: center;;">52,575.26 </td><td style="font-weight: bold;text-align: center;;">41,949.74 </td></tr><tr ><td style="color: #161120;text-align: center;">12</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td></tr><tr ><td style="color: #161120;text-align: center;">13</td><td style="text-align: center;;">5,049.71 </td><td style="text-align: center;;">2,800.29 </td><td style="text-align: right;;"></td><td style="text-align: center;;">5,049.71 </td><td style="text-align: center;;">2,800.29 </td></tr><tr ><td style="color: #161120;text-align: center;">14</td><td style="text-align: center;;">5,049.71 </td><td style="text-align: center;;">2,800.29 </td><td style="text-align: right;;"></td><td style="text-align: center;;">5,049.71 </td><td style="text-align: center;;">2,800.29 </td></tr><tr ><td style="color: #161120;text-align: center;">15</td><td style="text-align: center;;">13,358.78 </td><td style="text-align: center;;">11,641.22 </td><td style="text-align: right;;"></td><td style="text-align: center;;">13,358.78 </td><td style="text-align: center;;">11,641.22 </td></tr><tr ><td style="color: #161120;text-align: center;">16</td><td style="text-align: center;;">9,574.23 </td><td style="text-align: center;;">7,300.77 </td><td style="text-align: right;;"></td><td style="text-align: center;;">9,574.23 </td><td style="text-align: center;;">7,300.77 </td></tr><tr ><td style="color: #161120;text-align: center;">17</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="font-weight: bold;text-align: center;;">33,032.42 </td><td style="font-weight: bold;text-align: center;;">24,542.58 </td></tr><tr ><td style="color: #161120;text-align: center;">18</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td></tr><tr ><td style="color: #161120;text-align: center;">19</td><td style="text-align: center;;">12,156.49 </td><td style="text-align: center;;">10,593.51 </td><td style="text-align: right;;"></td><td style="text-align: center;;">12,156.49 </td><td style="text-align: center;;">10,593.51 </td></tr><tr ><td style="color: #161120;text-align: center;">20</td><td style="text-align: center;;">8,092.47 </td><td style="text-align: center;;">5,807.53 </td><td style="text-align: right;;"></td><td style="text-align: center;;">8,092.47 </td><td style="text-align: center;;">5,807.53 </td></tr><tr ><td style="color: #161120;text-align: center;">21</td><td style="text-align: center;;">8,092.47 </td><td style="text-align: center;;">5,807.53 </td><td style="text-align: right;;"></td><td style="text-align: center;;">8,092.47 </td><td style="text-align: center;;">5,807.53 </td></tr><tr ><td style="color: #161120;text-align: center;">22</td><td style="text-align: center;;">11,233.76 </td><td style="text-align: center;;">8,566.24 </td><td style="text-align: right;;"></td><td style="text-align: center;;">11,233.76 </td><td style="text-align: center;;">8,566.24 </td></tr><tr ><td style="color: #161120;text-align: center;">23</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="font-weight: bold;text-align: center;;">39,575.18 </td><td style="font-weight: bold;text-align: center;;">30,774.82 </td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">Sheet1</p><br /><br />
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
yes I manually did an autosum function on the ones you see there in bold. But I have over 5000 lines and it would take forever to do that manually
 
Upvote 0
Cant I use the subtotal function somehow
Are there any other fields that you are not showing?
If there is some sort of field that is the same within each block, but different between each block, then you may be able to use Subtotals.

Otherwise, a few questions for you:

1. Are there always two blank rows between each block of data that needs to be summed?

2. Does each block always have at least rows of data, or do any blocks just contain one row of data?
 
Upvote 0
Here's a bit of vb that might do the job. Try it on a copy of your data

Code:
Sub insertSum()
    Dim r1 As Range, r2 As Range, sRange As Range
    On Error Resume Next
    Set r1 = Columns("A:B").SpecialCells(xlCellTypeConstants, xlNumbers)
    Set r2 = Columns("A:B").SpecialCells(xlCellTypeFormulas, xlNumbers)
    If r1 Is Nothing Then
        Set sRange = r2
    ElseIf r2 Is Nothing Then
        Set sRange = r1
    Else
        Set sRange = Union(r1, r2)
    End If
    If Not sRange Is Nothing Then
        For Each a In sRange.Areas
            r = a.Rows.Count
            a.Cells(1, 1).Offset(r).Resize(, 2).FormulaR1C1 = "=sum(r[-1]c:r[-" & r & "]c)"
        Next a
    End If
End Sub
 
Upvote 0
No I added the blank rows so that I can put the sum of row F & G there. I can take the blanks out. Yes there are other field that i am not showing on this spreadsheet here. yes there is a field that is different between each set of numbers

<b>Excel 2002</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th><th>F</th><th>G</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="text-align: center;;">#</td><td style="text-align: center;;">Used</td><td style="text-align: center;;">Used Last</td><td style="text-align: right;;"></td><td style="text-align: center;;">#</td><td style="text-align: center;;">Used</td><td style="text-align: center;;">Used Last</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: center;;">3</td><td style="text-align: center;;">8,092.47 </td><td style="text-align: center;;">5,807.53 </td><td style="text-align: center;;"></td><td style="text-align: center;;">3</td><td style="text-align: center;;">8,092.47 </td><td style="text-align: center;;">5,807.53 </td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: center;;">3</td><td style="text-align: center;;">11,233.76 </td><td style="text-align: center;;">8,566.24 </td><td style="text-align: center;;"></td><td style="text-align: center;;">3</td><td style="text-align: center;;">11,233.76 </td><td style="text-align: center;;">8,566.24 </td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: center;;">3</td><td style="text-align: center;;">11,233.76 </td><td style="text-align: center;;">8,566.24 </td><td style="text-align: center;;"></td><td style="text-align: center;;">3</td><td style="text-align: center;;">11,233.76 </td><td style="text-align: center;;">8,566.24 </td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="font-weight: bold;text-align: center;;">30,559.99 </td><td style="font-weight: bold;text-align: center;;">22,940.01 </td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style="text-align: center;;">17</td><td style="text-align: center;;">9,574.23 </td><td style="text-align: center;;">7,300.77 </td><td style="text-align: center;;"></td><td style="text-align: center;;">17</td><td style="text-align: center;;">9,574.23 </td><td style="text-align: center;;">7,300.77 </td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style="text-align: center;;">17</td><td style="text-align: center;;">11,233.76 </td><td style="text-align: center;;">8,566.24 </td><td style="text-align: center;;"></td><td style="text-align: center;;">17</td><td style="text-align: center;;">11,233.76 </td><td style="text-align: center;;">8,566.24 </td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style="text-align: center;;">17</td><td style="text-align: center;;">13,358.78 </td><td style="text-align: center;;">11,641.22 </td><td style="text-align: center;;"></td><td style="text-align: center;;">17</td><td style="text-align: center;;">13,358.78 </td><td style="text-align: center;;">11,641.22 </td></tr><tr ><td style="color: #161120;text-align: center;">10</td><td style="text-align: center;;">17</td><td style="text-align: center;;">13,358.78 </td><td style="text-align: center;;">11,641.22 </td><td style="text-align: center;;"></td><td style="text-align: center;;">17</td><td style="text-align: center;;">13,358.78 </td><td style="text-align: center;;">11,641.22 </td></tr><tr ><td style="color: #161120;text-align: center;">11</td><td style="text-align: center;;">17</td><td style="text-align: center;;">5,049.71 </td><td style="text-align: center;;">2,800.29 </td><td style="text-align: center;;"></td><td style="text-align: center;;">17</td><td style="text-align: center;;">5,049.71 </td><td style="text-align: center;;">2,800.29 </td></tr><tr ><td style="color: #161120;text-align: center;">12</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="font-weight: bold;text-align: center;;">52,575.26 </td><td style="font-weight: bold;text-align: center;;">41,949.74 </td></tr><tr ><td style="color: #161120;text-align: center;">13</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td></tr><tr ><td style="color: #161120;text-align: center;">14</td><td style="text-align: center;;">254</td><td style="text-align: center;;">5,049.71 </td><td style="text-align: center;;">2,800.29 </td><td style="text-align: center;;"></td><td style="text-align: center;;">254</td><td style="text-align: center;;">5,049.71 </td><td style="text-align: center;;">2,800.29 </td></tr><tr ><td style="color: #161120;text-align: center;">15</td><td style="text-align: center;;">254</td><td style="text-align: center;;">5,049.71 </td><td style="text-align: center;;">2,800.29 </td><td style="text-align: center;;"></td><td style="text-align: center;;">254</td><td style="text-align: center;;">5,049.71 </td><td style="text-align: center;;">2,800.29 </td></tr><tr ><td style="color: #161120;text-align: center;">16</td><td style="text-align: center;;">254</td><td style="text-align: center;;">13,358.78 </td><td style="text-align: center;;">11,641.22 </td><td style="text-align: center;;"></td><td style="text-align: center;;">254</td><td style="text-align: center;;">13,358.78 </td><td style="text-align: center;;">11,641.22 </td></tr><tr ><td style="color: #161120;text-align: center;">17</td><td style="text-align: center;;">254</td><td style="text-align: center;;">9,574.23 </td><td style="text-align: center;;">7,300.77 </td><td style="text-align: center;;"></td><td style="text-align: center;;">254</td><td style="text-align: center;;">9,574.23 </td><td style="text-align: center;;">7,300.77 </td></tr><tr ><td style="color: #161120;text-align: center;">18</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="font-weight: bold;text-align: center;;">33,032.42 </td><td style="font-weight: bold;text-align: center;;">24,542.58 </td></tr><tr ><td style="color: #161120;text-align: center;">19</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td></tr><tr ><td style="color: #161120;text-align: center;">20</td><td style="text-align: center;;">78</td><td style="text-align: center;;">12,156.49 </td><td style="text-align: center;;">10,593.51 </td><td style="text-align: center;;"></td><td style="text-align: center;;">78</td><td style="text-align: center;;">12,156.49 </td><td style="text-align: center;;">10,593.51 </td></tr><tr ><td style="color: #161120;text-align: center;">21</td><td style="text-align: center;;">78</td><td style="text-align: center;;">8,092.47 </td><td style="text-align: center;;">5,807.53 </td><td style="text-align: center;;"></td><td style="text-align: center;;">78</td><td style="text-align: center;;">8,092.47 </td><td style="text-align: center;;">5,807.53 </td></tr><tr ><td style="color: #161120;text-align: center;">22</td><td style="text-align: center;;">78</td><td style="text-align: center;;">8,092.47 </td><td style="text-align: center;;">5,807.53 </td><td style="text-align: center;;"></td><td style="text-align: center;;">78</td><td style="text-align: center;;">8,092.47 </td><td style="text-align: center;;">5,807.53 </td></tr><tr ><td style="color: #161120;text-align: center;">23</td><td style="text-align: center;;">78</td><td style="text-align: center;;">11,233.76 </td><td style="text-align: center;;">8,566.24 </td><td style="text-align: center;;"></td><td style="text-align: center;;">78</td><td style="text-align: center;;">11,233.76 </td><td style="text-align: center;;">8,566.24 </td></tr><tr ><td style="color: #161120;text-align: center;">24</td><td style="text-align: right;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="font-weight: bold;text-align: center;;">39,575.18 </td><td style="font-weight: bold;text-align: center;;">30,774.82 </td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">Sheet1</p><br /><br />
 
Last edited:
Upvote 0
No I added the blank rows so that I can put the sum of row F & G there. I can take the blanks out. Yes there are other field that i am not showing on this spreadsheet here. yes there is a field that is different between each set of numbers
Then it should be pretty easy to use Subtotals.
Did you try, it is pretty straightforward?

Just highlight your data, select Subtotals and select your first field for "At each change in", select the Sum function, and select your last two fields.

That should do it!
 
Upvote 0
Like this perhaps?

Excel Workbook
ABCD
18,092.475,807.538,092.475,807.53
211,233.768,566.2411,233.768,566.24
311,233.768,566.2411,233.768,566.24
430559.9922940.01
5
69,574.237,300.779,574.237,300.77
711,233.768,566.2411,233.768,566.24
813,358.7811,641.2213,358.7811,641.22
913,358.7811,641.2213,358.7811,641.22
105,049.712,800.295,049.712,800.29
1152575.2641949.74
12
135,049.712,800.295,049.712,800.29
145,049.712,800.295,049.712,800.29
1513,358.7811,641.2213,358.7811,641.22
169,574.237,300.779,574.237,300.77
1733032.4324542.57
18
1912,156.4910,593.5112,156.4910,593.51
208,092.475,807.538,092.475,807.53
218,092.475,807.538,092.475,807.53
2211,233.768,566.2411,233.768,566.24
2339575.1930774.81
Sheet1
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,285
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top