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 / Worksheet Functions / August 2006

Tip: Looking for answers? Try searching our database.

indicate a number of rows to sum

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
donna-LexusWebs - 20 Aug 2006 04:06 GMT
I would like to create a list of numbers (ie: from A2:A25). Then have a field
that a user can put in a number to indicate the number of rows to sum into a
third field. Ie: input the number 3 to cell C1. The sum of cells A2:A4 would
be returned into the result field, say, cell C3.

Assume that A2 will always be the first number in the sum equation.  If the
value in C1 were changed to 4, the result in C3 would be 19 since it would
include the number in the range.  See sample below. Any clues??

        A      B       C      D
1                        3
2       6
3       9              16
4       1
5       3
6       7
7       4
Biff - 20 Aug 2006 04:24 GMT
Hi!

Try this:

=IF(C1="","",SUM(A2:INDEX(A2:A25,C1)))

If C1 is empty then the entire range would be summed. That's why I test for
C1 being empty.

Biff

>I would like to create a list of numbers (ie: from A2:A25). Then have a
>field
[quoted text clipped - 17 lines]
> 6       7
> 7       4
donna-LexusWebs - 20 Aug 2006 04:39 GMT
Perfect, thank you!

> Hi!
>
[quoted text clipped - 28 lines]
> > 6       7
> > 7       4
Biff - 20 Aug 2006 04:50 GMT
You're welcome!

Biff

> Perfect, thank you!
>
[quoted text clipped - 33 lines]
>> > 6       7
>> > 7       4
 
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.