#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Sum of an array

Is there anyway to sum a range of values given a specific number of
cells you choose to sum. For example you have a range from A1:F1,
G1=number of cells you want to sum from left to right, and H1 is the
total. So if G1=3, then H1=sum(A1:C1) or 16. If G1=5, then
H1=sum(A1:E1) or 20.


A B C D E F G H

1 3 5 8 3 1 7 Var Sum

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Sum of an array

In H1,

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

HTH,
Bernie
MS Excel MVP


wrote in message
...
Is there anyway to sum a range of values given a specific number of
cells you choose to sum. For example you have a range from A1:F1,
G1=number of cells you want to sum from left to right, and H1 is the
total. So if G1=3, then H1=sum(A1:C1) or 16. If G1=5, then
H1=sum(A1:E1) or 20.


A B C D E F G H

1 3 5 8 3 1 7 Var Sum

Thanks in advance.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Sum of an array

Non-volatile approach:

=SUM(A1:INDEX(A1:F1,G1))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------


wrote in message
...
Is there anyway to sum a range of values given a specific number of
cells you choose to sum. For example you have a range from A1:F1,
G1=number of cells you want to sum from left to right, and H1 is the
total. So if G1=3, then H1=sum(A1:C1) or 16. If G1=5, then
H1=sum(A1:E1) or 20.


A B C D E F G H

1 3 5 8 3 1 7 Var Sum

Thanks in advance.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Sum of an array

On Oct 29, 7:04*pm, "Ragdyer" wrote:
Non-volatile approach:

=SUM(A1:INDEX(A1:F1,G1))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

wrote in message

...

Is there anyway to sum a range of values given a specific number of
cells you choose to sum. *For example you have a range from A1:F1,
G1=number of cells you want to sum from left to right, and H1 is the
total. *So if G1=3, then H1=sum(A1:C1) or 16. *If G1=5, then
H1=sum(A1:E1) or 20.


A B C D E F G H


1 3 5 8 3 1 7 Var Sum


Thanks in advance.


Perfect! Thanks a bunch!
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Sum of an array

You're welcome, and appreciate the feed-back.
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
wrote in message
...
On Oct 29, 7:04 pm, "Ragdyer" wrote:
Non-volatile approach:

=SUM(A1:INDEX(A1:F1,G1))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

wrote in message

...

Is there anyway to sum a range of values given a specific number of
cells you choose to sum. For example you have a range from A1:F1,
G1=number of cells you want to sum from left to right, and H1 is the
total. So if G1=3, then H1=sum(A1:C1) or 16. If G1=5, then
H1=sum(A1:E1) or 20.


A B C D E F G H


1 3 5 8 3 1 7 Var Sum


Thanks in advance.


Perfect! Thanks a bunch!


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
Prevent cell/array references from changing when altering/moving thecell/array nme Excel Discussion (Misc queries) 1 September 19th 08 01:53 PM
Populate an array that is a subset of a larger array? Jeff Excel Worksheet Functions 1 September 25th 07 12:51 AM
Array: Counting multiple values within array Trilux_nogo Excel Worksheet Functions 4 April 16th 07 03:12 AM
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
combining cells and array from different sheets into an array to pass to IRR() [email protected] Excel Discussion (Misc queries) 3 September 11th 06 07:17 AM


All times are GMT +1. The time now is 05:06 PM.

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

About Us

"It's about Microsoft Excel"