Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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???? |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
try this idea where a11 has 1,2,3,4,5,etc
=SUM(B12:OFFSET(B12,1,A11-1)) -- Don Guillett Microsoft MVP Excel SalesAid Software "Flanno" wrote in message ... 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???? |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 On May 16, 3:33*pm, Flanno wrote: 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???? |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
If the range contains blanks try this array entered with CTRL+Shift+Enter
=SUM(A100:INDEX(A1:A100,LARGE(ROW(A1:A100)*(A1:A10 0<""),B1))) where B1 contains the rows to sum Mike "Flanno" wrote: 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???? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
sumif for multi conditions. i.e sumif(A1:A10,"Jon" and B1:B10,"A" | Excel Worksheet Functions | |||
SUMIF Help | Excel Discussion (Misc queries) | |||
Embedding a Sumif in a sumif | Excel Worksheet Functions | |||
nested sumif or sumif with two criteria | Excel Worksheet Functions | |||
SUMIF - Range name to used for the "sum_range" portion of a SUMIF function | Excel Worksheet Functions |