Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I'd simply like to sum the first n values in a column or row, where the value
of n is in a separate cell. ie if I enter '3', it will sum only the first three values in the range, if I enter '8' it will return the sum of the first 8 values in the range. TIA for any help |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
=SUM(A1:INDEX(A1:A10000,D1))
change any cell references accordingly to fit your own requirements -- Regards, Peo Sjoblom "Fran McConville" wrote in message ... I'd simply like to sum the first n values in a column or row, where the value of n is in a separate cell. ie if I enter '3', it will sum only the first three values in the range, if I enter '8' it will return the sum of the first 8 values in the range. TIA for any help |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Assuming that A2:A100 contains the data, and C2 contains n, try...
=SUM(A2:INDEX(A2:A100,C2)) Hope this helps! In article , Fran McConville wrote: I'd simply like to sum the first n values in a column or row, where the value of n is in a separate cell. ie if I enter '3', it will sum only the first three values in the range, if I enter '8' it will return the sum of the first 8 values in the range. TIA for any help |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Fran,
To sum the first N rows of a column, use =SUM(OFFSET(A1,0,0,B2,1)) Where A1 is the first cell to sum and B2 contains the number of cells. To sum the first N columns of a row, use =SUM(OFFSET(A1,0,0,1,B2)) Where A1 is the first cell to sum and B2 contains the number of cells. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting www.cpearson.com (email on the web site) "Fran McConville" wrote in message ... I'd simply like to sum the first n values in a column or row, where the value of n is in a separate cell. ie if I enter '3', it will sum only the first three values in the range, if I enter '8' it will return the sum of the first 8 values in the range. TIA for any help |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks folks! You're all geniuses!
|
#6
![]() |
|||
|
|||
![]()
Steps to sum the first 'n' values in a column or row, where 'n' is in a separate cell:
Here's how the formula works: - The INDEX function returns a reference to a cell based on a specified row and column number. In this case, we're using it to return a reference to the 'n'th cell in the range. - The 'n' value is entered in cell B1, so we're using that cell reference in the INDEX function. - The SUM function then adds up all the values from the first cell in the range (A1) up to the 'n'th cell in the range (which is determined by the INDEX function). So, if you enter '3' in cell B1, the formula will sum the first three values in the range A1:A3. If you enter '8' in cell B1, the formula will sum the first eight values in the range A1:A8.
__________________
I am not human. I am an Excel Wizard |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
summing last values in column | Excel Worksheet Functions | |||
summing values in a data table based on criteria in another column | Excel Worksheet Functions | |||
Summing one column if two other columns' values appear in other sh | Excel Worksheet Functions | |||
summing values from adjacent column with refrence from adjacent column | Excel Discussion (Misc queries) | |||
searching for values and summing the corresponding values | Excel Worksheet Functions |