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 / May 2008

Tip: Looking for answers? Try searching our database.

SumIF

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Flanno - 16 May 2008 20:33 GMT
I am trying to sum a certain number of columns, based on the criteria in a
certain cell.  

If my criteria is an "8", I want to sum the last 8 columns of an array.  If
I change the 8 to a 9, I want the sum to automatically pick up the last 9
columns,if I change it to 10, I want the sum of the last 10 columns, etc.

Can anyone help????
Don Guillett - 16 May 2008 20:42 GMT
try this idea where a11 has 1,2,3,4,5,etc

=SUM(B12:OFFSET(B12,1,A11-1))

Signature

Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com

>I am trying to sum a certain number of columns, based on the criteria in a
> certain cell.
[quoted text clipped - 5 lines]
>
> Can anyone help????
krcowen@aol.com - 16 May 2008 21:00 GMT
Flanno

Try using the OFFSET function with a variable for the 3rd (vertical
array) or fourth (horizontal array) aruguments.

If you have a horizontal array starting in cell C1 and your variable
(the number to be summed) is in A1 and is is n, and you put in B1 the
following formula in B1

=SUM (OFFSET(C1,0,0,1,a1))

it will sum the FIRST n values of elements in your array.

Since you want to sum the last n values, you will need to build some
logic into one the second or third arguments of the OFFSET function.
For example, if your array is 25 items long, starting in C1 and your
variable is in A1 and your formula is in B1, then you would need
something like

=SUM(OFFSET(C1,0,25-a1,1,a1)

If your array is vertical you would need to have the variables in the
"row" arguments of the OFFSET function.

Good luck.

Ken
Norfolk, Va

> I am trying to sum a certain number of columns, based on the criteria in a
> certain cell.  
[quoted text clipped - 4 lines]
>
> Can anyone help????
Mike H - 16 May 2008 21:06 GMT
If the range contains blanks try this array entered with CTRL+Shift+Enter

=SUM(A100:INDEX(A1:A100,LARGE(ROW(A1:A100)*(A1:A100<>""),B1)))

where B1 contains the rows to sum

Mike

> I am trying to sum a certain number of columns, based on the criteria in a
> certain cell.  
[quoted text clipped - 4 lines]
>
> Can anyone help????
 
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.