Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default How to sum a variable number of items

How do I sum the first X cells in a list where X is defined in another cell?

Specifically, I have a list of numbers in cells B4:B30.

In cell A1, I have another number, which I want to be able to change around.
So that if A1=4, then I sum B4:B8, but if A1=5, then I sum B4:B9 and so on.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default How to sum a variable number of items

One way

=SUM(B4:INDEX(B4:B30,A1))


--


Regards,


Peo Sjoblom



"RobinC" wrote in message
...
How do I sum the first X cells in a list where X is defined in another
cell?

Specifically, I have a list of numbers in cells B4:B30.

In cell A1, I have another number, which I want to be able to change
around.
So that if A1=4, then I sum B4:B8, but if A1=5, then I sum B4:B9 and so
on.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,646
Default How to sum a variable number of items

=SUM(OFFSET(B4,0,0,A1,1))

Regards,
Stefi

€˛RobinC€¯ ezt Ć*rta:

How do I sum the first X cells in a list where X is defined in another cell?

Specifically, I have a list of numbers in cells B4:B30.

In cell A1, I have another number, which I want to be able to change around.
So that if A1=4, then I sum B4:B8, but if A1=5, then I sum B4:B9 and so on.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sum a different number of items mr tom Excel Worksheet Functions 5 May 2nd 08 07:43 PM
number of items fit into item Dreamstar_1961 Excel Worksheet Functions 9 May 6th 07 03:33 PM
reference with variable row number ? Arc_K Excel Worksheet Functions 7 October 23rd 06 06:47 PM
Number of items in a colum Excel Worksheet Functions 1 May 9th 06 01:56 PM
Number of items per day in chart. Web master Charts and Charting in Excel 2 January 27th 06 02:54 AM


All times are GMT +1. The time now is 04:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"