Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / December 2006

Tip: Looking for answers? Try searching our database.

Formula help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ian - 29 Dec 2006 20:10 GMT
I need a formula which can be copied to any row in a spreadsheet to produce
a sum of the rows above startign at row 2.
eg =SUM(G2:Gthisrow-1)
I also need one to calculate the difference MIN & MAX in the same manner

It is going to be stored in another sheet and manually copy/pasted so I
suspect I may need to start the range reference with G$2, but I'm not sure.
Anyway, that's the easy bit. The hard bit (to me) is the relative reference.
I know how to do it in VBA code, but I need an in-cell formula.

Any ideas?

Signature

Ian
--

Don Guillett - 29 Dec 2006 20:38 GMT
Where 9999 is any number larger than possible in your range
=SUM(A1:OFFSET(A1,MATCH(99999,A:A),0))

Signature

Don Guillett
SalesAid Software
dguillett1@austin.rr.com

>I need a formula which can be copied to any row in a spreadsheet to produce
>a sum of the rows above startign at row 2.
[quoted text clipped - 7 lines]
>
> Any ideas?
Gary''s Student - 29 Dec 2006 20:39 GMT
This is even better because it does not depend on the column ID:

=SUM(INDIRECT(ADDRESS(2,COLUMN())):INDIRECT(ADDRESS(ROW()-1,COLUMN())))

Signature

Gary's Student

> I need a formula which can be copied to any row in a spreadsheet to produce
> a sum of the rows above startign at row 2.
[quoted text clipped - 7 lines]
>
> Any ideas?
OM - 29 Dec 2006 22:56 GMT
Great solution Gary's Student! I thought I was "reasonably good" at Excel,
but seems I have a lot left to learn....

OM

> This is even better because it does not depend on the column ID:
>
[quoted text clipped - 14 lines]
>>
>> Any ideas?
Gary''s Student - 29 Dec 2006 23:13 GMT
Thanks for the complement.  Harlan's solution, however, is even better.
Signature

Gary's Student

> Great solution Gary's Student! I thought I was "reasonably good" at Excel,
> but seems I have a lot left to learn....
[quoted text clipped - 19 lines]
> >>
> >> Any ideas?
Peo Sjoblom - 29 Dec 2006 23:28 GMT
Here's a non volatile version (not tested except for on a small dataset)
the bonus of using non volatile functions (INDIRECT is volatile) is that
you won't be asked to save the workbook every time you open and close
the workbook

=SUM(INDEX($1:$65536,2,COLUMN()):INDEX($1:$65536,ROW()-1,COLUMN()))

Regards,

Peo Sjoblom,

> Great solution Gary's Student! I thought I was "reasonably good" at Excel,
> but seems I have a lot left to learn....
[quoted text clipped - 19 lines]
>>>
>>> Any ideas?
Harlan Grove - 29 Dec 2006 20:53 GMT
Ian wrote...
>I need a formula which can be copied to any row in a spreadsheet to produce
>a sum of the rows above startign at row 2.
>eg =SUM(G2:Gthisrow-1)
>I also need one to calculate the difference MIN & MAX in the same manner

The other respondents were warm, but the best answer involving volatile
functions is

=SUM(INDIRECT("R2C7:R[-1]C7",0))

if you always want to refer to column G (the 7th column in the
worksheet). If the formula above would have been entered in column G in
the row immediately below the values to be summed, and if you'd be
doing this for other columns as well, try

=SUM(INDIRECT("R2C:R[-1]C",0))

But you don't need to use volatile functions.

=SUM(G$2:INDEX(G:G,ROW()-1))

If the MIN and MAX formulas would be underneath the SUM formula, they'd
need to refer, respectively, to ranges ending 2 or 3 rows above, so

=MIN(G$2:INDEX(G:G,ROW()-2))

and

=MAX(G$2:INDEX(G:G,ROW()-3))
Ian - 30 Dec 2006 21:57 GMT
Thanks, Harlan. This seems to be what I'm looking for.

Thanks, also to everyone else who's chipped in. I'm sure I can learn
something from each of your responses.

Happy new year.

Signature

Ian
--

> Ian wrote...
>>I need a formula which can be copied to any row in a spreadsheet to
[quoted text clipped - 27 lines]
>
> =MAX(G$2:INDEX(G:G,ROW()-3))
Dave Peterson - 29 Dec 2006 21:44 GMT
Another one if the formula is going in G100:

=sum(g2:offset(g99,-1,0))

Adjust the 99 to be one less row than the cell's row that's getting the formula.

But I'm confused about what you mean about storing it in another worksheet.

And an alternative suggestion...

Insert a new Row 1 and put the formula in that.

=sum(g3:g65536)
(headers in row 2)

And if you use window|Freeze panes, your totals will always be visible.

And if you used data|filter|autofilter and =subtotal() as your formula, then
those formulas would just count/sum... the visible cells.

> I need a formula which can be copied to any row in a spreadsheet to produce
> a sum of the rows above startign at row 2.
[quoted text clipped - 11 lines]
> Ian
> --

Signature

Dave Peterson

Ian - 30 Dec 2006 22:02 GMT
The problem is that I don't know what row it will be going in. It will vary
each time and I was looking for a solution where I can copy/paste a range of
cells containing formulae from another location.

The spreadsheet will be produced automatically by Access as an email
attachment. Before the email goes, I currently open the attachment and
manually add formulae. It would be much earier if I could copy/paste
ready-made formulae from another spreadsheet.

I probably didn't explain myself too well in my OP.

Thanks for the input, but I think Harlan's message addresses my needs.

Happy new year.

Signature

Ian
--

> Another one if the formula is going in G100:
>
[quoted text clipped - 37 lines]
>> Ian
>> --
Dave Peterson - 30 Dec 2006 22:22 GMT
You'll know where you're going to store the formula, right.

If you store it in A3, then try this:
=SUM(A$2:OFFSET(A3,-1,0))

Then copy and paste it into other cells to see if it does what you want.  Excel
is pretty smart and will adjust the formula nicely.

Stay out of A2 and A1, though.

> The problem is that I don't know what row it will be going in. It will vary
> each time and I was looking for a solution where I can copy/paste a range of
[quoted text clipped - 59 lines]
> >
> > Dave Peterson

Signature

Dave Peterson


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.