ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Sum of Variable Cells in a fixed Row (https://www.excelbanter.com/excel-worksheet-functions/447078-sum-variable-cells-fixed-row.html)

VinB

Sum of Variable Cells in a fixed Row
 
I am stuck with this dilemma please help I need to sum cells a row with a variable range that is dependent of a number a user of the work sheet types.

Cell A1: __ User Defined Variable {1,2,3 ect.)

Column A B C D E F
Row2 5 7 8 5 3 2 Sum A2:C2 if User defined Variable is 3
Row3 4 1 7 5 9 6 Sum A3:E3 if User defined Variable is 4
Row4 1 5 7 8 5 7 Sum A4:B4 if User defined Variable is 2

Please help
Tks

[email protected]

Sum of Variable Cells in a fixed Row
 
On Sunday, September 9, 2012 8:16:34 PM UTC-7, VinB wrote:
I am stuck with this dilemma please help I need to sum cells a row with

a variable range that is dependent of a number a user of the work sheet

types.



Cell A1: __ User Defined Variable {1,2,3 ect.)



Column A B C D E F

Row2 5 7 8 5 3 2 Sum A2:C2 if User defined Variable is 3

Row3 4 1 7 5 9 6 Sum A3:E3 if User defined Variable is 4

Row4 1 5 7 8 5 7 Sum A4:B4 if User defined Variable is 2



Please help

Tks









--

VinB


Hi VinB

In K1,2,3 enter 3,4,2.
In L1,2,3 enter =A2+C2, =A3+E3, =A4+B4
In J1 enter =VLOOKUP(A1,K1:L3,2,0)
In A1 enter the User defined variable.

HTH
Regard,
Howard

Claus Busch

Sum of Variable Cells in a fixed Row
 
Hi,

Am Mon, 10 Sep 2012 03:16:34 +0000 schrieb VinB:

I am stuck with this dilemma please help I need to sum cells a row with
a variable range that is dependent of a number a user of the work sheet
types.

Cell A1: __ User Defined Variable {1,2,3 ect.)

Column A B C D E F
Row2 5 7 8 5 3 2 Sum A2:C2 if User defined Variable is 3
Row3 4 1 7 5 9 6 Sum A3:E3 if User defined Variable is 4
Row4 1 5 7 8 5 7 Sum A4:B4 if User defined Variable is 2


try:
=SUM(OFFSET($A2,,,,$A$1))


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

VinB

Quote:

Originally Posted by Claus Busch (Post 1605362)
Hi,

Am Mon, 10 Sep 2012 03:16:34 +0000 schrieb VinB:

I am stuck with this dilemma please help I need to sum cells a row with
a variable range that is dependent of a number a user of the work sheet
types.

Cell A1: __ User Defined Variable {1,2,3 ect.)

Column A B C D E F
Row2 5 7 8 5 3 2 Sum A2:C2 if User defined Variable is 3
Row3 4 1 7 5 9 6 Sum A3:E3 if User defined Variable is 4
Row4 1 5 7 8 5 7 Sum A4:B4 if User defined Variable is 2


try:
=SUM(OFFSET($A2,,,,$A$1))


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

Hey Claus,

Many thanks it works

Brgds
Vin


All times are GMT +1. The time now is 04:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com