Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Sum X Number of Columns

Hi and thanks in advance for any help provided. I am trying to simplify a
nested if statement formula that sums columns of data based on the number in
another column. Here is an example:

Weeks to Sum Wk1 Wk2 Wk3 Wk4 Wk5 Wk6 Wk7 Wk8
4 100 150 160 170 180 200
200 200
2 50 60 70 70 70 65
60 60
etc...

In the first line, I need to sume the first 4 values for a total of 580, in
the second line I need the sum of the first 2 for a total of 110. It seems
like there must be a simple formula to do this but my search has come up
empty.

Thx

Russell
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,355
Default Sum X Number of Columns

I'm not clear on what you want. You want a total of the first 4 in the
first row (row 2?), first 2 in row 3? How many rows are you summing?

Barb Reinhardt



"Russell Hill" wrote:

Hi and thanks in advance for any help provided. I am trying to simplify a
nested if statement formula that sums columns of data based on the number in
another column. Here is an example:

Weeks to Sum Wk1 Wk2 Wk3 Wk4 Wk5 Wk6 Wk7 Wk8
4 100 150 160 170 180 200
200 200
2 50 60 70 70 70 65
60 60
etc...

In the first line, I need to sume the first 4 values for a total of 580, in
the second line I need the sum of the first 2 for a total of 110. It seems
like there must be a simple formula to do this but my search has come up
empty.

Thx

Russell

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Sum X Number of Columns

On Tue, 19 Aug 2008 16:46:01 -0700, Russell Hill
wrote:

Hi and thanks in advance for any help provided. I am trying to simplify a
nested if statement formula that sums columns of data based on the number in
another column. Here is an example:

Weeks to Sum Wk1 Wk2 Wk3 Wk4 Wk5 Wk6 Wk7 Wk8
4 100 150 160 170 180 200
200 200
2 50 60 70 70 70 65
60 60
etc...

In the first line, I need to sume the first 4 values for a total of 580, in
the second line I need the sum of the first 2 for a total of 110. It seems
like there must be a simple formula to do this but my search has come up
empty.

Thx

Russell


If the number of Weeks to Sum is in A1, and your data starts in B1, then:

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

--ron
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,344
Default Sum X Number of Columns

Here is one solution among many:

=SUM(OFFSET(B2,,,,A2))

Assume that the you enter the items (weeks data) starting in B2 and you
enter the number of columns you want to sum in A2. Then in a blank cell
enter the above formula.

--
Cheers,
Shane Devenshire


"Russell Hill" wrote:

Hi and thanks in advance for any help provided. I am trying to simplify a
nested if statement formula that sums columns of data based on the number in
another column. Here is an example:

Weeks to Sum Wk1 Wk2 Wk3 Wk4 Wk5 Wk6 Wk7 Wk8
4 100 150 160 170 180 200
200 200
2 50 60 70 70 70 65
60 60
etc...

In the first line, I need to sume the first 4 values for a total of 580, in
the second line I need the sum of the first 2 for a total of 110. It seems
like there must be a simple formula to do this but my search has come up
empty.

Thx

Russell

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Sum X Number of Columns

One mo

=IF(A2=0,"",SUM(B2:INDEX(B2:H2,A2)))

Adjust the columns to match.



Russell Hill wrote:

Hi and thanks in advance for any help provided. I am trying to simplify a
nested if statement formula that sums columns of data based on the number in
another column. Here is an example:

Weeks to Sum Wk1 Wk2 Wk3 Wk4 Wk5 Wk6 Wk7 Wk8
4 100 150 160 170 180 200
200 200
2 50 60 70 70 70 65
60 60
etc...

In the first line, I need to sume the first 4 values for a total of 580, in
the second line I need the sum of the first 2 for a total of 110. It seems
like there must be a simple formula to do this but my search has come up
empty.

Thx

Russell


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Sum X Number of Columns

Thanks all! The OFFSET function is exactly what I was looking for.

"ShaneDevenshire" wrote:

Here is one solution among many:

=SUM(OFFSET(B2,,,,A2))

Assume that the you enter the items (weeks data) starting in B2 and you
enter the number of columns you want to sum in A2. Then in a blank cell
enter the above formula.

--
Cheers,
Shane Devenshire


"Russell Hill" wrote:

Hi and thanks in advance for any help provided. I am trying to simplify a
nested if statement formula that sums columns of data based on the number in
another column. Here is an example:

Weeks to Sum Wk1 Wk2 Wk3 Wk4 Wk5 Wk6 Wk7 Wk8
4 100 150 160 170 180 200
200 200
2 50 60 70 70 70 65
60 60
etc...

In the first line, I need to sume the first 4 values for a total of 580, in
the second line I need the sum of the first 2 for a total of 110. It seems
like there must be a simple formula to do this but my search has come up
empty.

Thx

Russell

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
number of columns rob Excel Discussion (Misc queries) 2 July 15th 07 10:42 AM
NUmber of Columns M&M[_2_] Excel Discussion (Misc queries) 6 July 14th 07 12:58 PM
number of columns ekkeindoha Excel Discussion (Misc queries) 4 July 8th 07 03:31 PM
Number of columns Duplex Excel Discussion (Misc queries) 3 October 20th 06 02:02 PM
Number of columns ? Toosje Excel Worksheet Functions 2 March 16th 05 11:41 AM


All times are GMT +1. The time now is 01:21 PM.

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"