Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default SUM formula that resizes?

Is there a SUM formula that can automatically resize as you copy and paste
it, such that ,it will sum all the previous rows up to the previous SUM
formula?

What I want to do is very similar to a subtotal, but without any common item
to subtotal by.

EXAMPLE:
1] 7
2] 5
3] 6
4] <SUM formula here for rows 1-3 RESULT 18
5] 2
6] 8
7] <copy above formula from 4, but have SUM rows 5-6 RESULT 10
8] 3
9] <copy above formula from 4, but have SUM row 8 RESULT 3

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,069
Default SUM formula that resizes?

Just use the AutoSum button on the Standard toolbar. It will behave the way
you described.

Hope this helps,

Hutch

"Excel Curious" wrote:

Is there a SUM formula that can automatically resize as you copy and paste
it, such that ,it will sum all the previous rows up to the previous SUM
formula?

What I want to do is very similar to a subtotal, but without any common item
to subtotal by.

EXAMPLE:
1] 7
2] 5
3] 6
4] <SUM formula here for rows 1-3 RESULT 18
5] 2
6] 8
7] <copy above formula from 4, but have SUM rows 5-6 RESULT 10
8] 3
9] <copy above formula from 4, but have SUM row 8 RESULT 3

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default SUM formula that resizes?

It only sort of works. I occasionaly also have blank rows, so it ends up only
adding everything below the blank.

"Tom Hutchins" wrote:

Just use the AutoSum button on the Standard toolbar. It will behave the way
you described.

Hope this helps,

Hutch

"Excel Curious" wrote:

Is there a SUM formula that can automatically resize as you copy and paste
it, such that ,it will sum all the previous rows up to the previous SUM
formula?

What I want to do is very similar to a subtotal, but without any common item
to subtotal by.

EXAMPLE:
1] 7
2] 5
3] 6
4] <SUM formula here for rows 1-3 RESULT 18
5] 2
6] 8
7] <copy above formula from 4, but have SUM rows 5-6 RESULT 10
8] 3
9] <copy above formula from 4, but have SUM row 8 RESULT 3

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,069
Default SUM formula that resizes?

Okay, try this user-defined function. You need to paste this function into a
VBA module in your workbook.

Public Function SumMore() As Double
Dim x As Long, Ttl As Double
Ttl = 0
For x = 1 To Application.Caller.Row - 1
If Left(Application.Caller.Offset(-x, 0).Formula, 5) = "=SUM(" Then
Exit For
ElseIf IsNumeric(Application.Caller.Offset(-x, 0).Value) Then
Ttl = Ttl + Application.Caller.Offset(-x, 0).Value
End If
Next x
SumMore = Ttl
End Function

You can call it manually by putting the following fornula in any cell:

=SumMore()+(NOW()*0)

This macro puts that formula in the active cell. You could attach this macro
to a custom toolbar button:

Sub AddSumMore()
ActiveCell.Formula = "=SumMore()+(NOW()*0)"
End Sub

The function would have to be added to every workbook where you want to use
it. It will ignore text and empty cells. If you are new to macros, you may
find this Jon Peltier link helpful:

http://peltiertech.com/WordPress/200...e-elses-macro/

Hope this helps,

Hutch

"Excel Curious" wrote:

It only sort of works. I occasionaly also have blank rows, so it ends up only
adding everything below the blank.

"Tom Hutchins" wrote:

Just use the AutoSum button on the Standard toolbar. It will behave the way
you described.

Hope this helps,

Hutch

"Excel Curious" wrote:

Is there a SUM formula that can automatically resize as you copy and paste
it, such that ,it will sum all the previous rows up to the previous SUM
formula?

What I want to do is very similar to a subtotal, but without any common item
to subtotal by.

EXAMPLE:
1] 7
2] 5
3] 6
4] <SUM formula here for rows 1-3 RESULT 18
5] 2
6] 8
7] <copy above formula from 4, but have SUM rows 5-6 RESULT 10
8] 3
9] <copy above formula from 4, but have SUM row 8 RESULT 3

Thanks

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
Horizontal Scroll Bar Resizes Sheet!!?? Arun Excel Discussion (Misc queries) 2 August 15th 07 06:44 PM
Chart resizes with changes to hidden cells Pflugs Excel Discussion (Misc queries) 2 August 3rd 07 03:08 PM
Chart Resizes After Printing or Print-Preview CA Excel Discussion (Misc queries) 3 June 12th 07 08:21 PM
Troubleshooting comments: when box resizes and moves location econnolly Excel Worksheet Functions 0 February 17th 06 12:44 AM
Help resizes window &%$#! Oskar von dem Hagen Excel Discussion (Misc queries) 0 February 26th 05 01:09 AM


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