goss
Active Member
- Joined
- Feb 2, 2004
- Messages
- 372
Hi all,
Using Excel 2010.
I would like to be able to find the sum of a varying number of columns based on user defined criteria.
If user defines column 6, just colmn 6 (period end total)
If column 5 : sum(1-5)
If column 4 : sum(1-4)
And so forth...
My formula currently works for 1 column only. How may I adapt to variable columns per above?
=SUMPRODUCT((Data!$A$2:$A$2020=$B7)*(Data!$E$2:$E$2020=K$6)*(INDEX(Data!$F$2:$K$2020,0,MATCH(WK,Data!$F$1:$K$1,0))))
WK is a defined name on the setup tab where the user may enter 1-6
Using Excel 2010.
I would like to be able to find the sum of a varying number of columns based on user defined criteria.
If user defines column 6, just colmn 6 (period end total)
If column 5 : sum(1-5)
If column 4 : sum(1-4)
And so forth...
My formula currently works for 1 column only. How may I adapt to variable columns per above?
=SUMPRODUCT((Data!$A$2:$A$2020=$B7)*(Data!$E$2:$E$2020=K$6)*(INDEX(Data!$F$2:$K$2020,0,MATCH(WK,Data!$F$1:$K$1,0))))
WK is a defined name on the setup tab where the user may enter 1-6