excel - How to return the sum of a row - INDEX appears not to "rotate" -


excel problem. imagine simple matrix m, 8r x 10c. suppose 1c contains search criteria. wish return sum of of numbers in 5-8c of every row in 1c matches 10. suppose c=index(m,0,1) , v={0,0,0,0,1,1,1,1,0,0} conceptually should able write =sumproduct((c=10)*sumproduct(index(m,row(m),0),v)).

i cannot work. c vertical vector {0;1; ...} , therefore should induce first sumproduct loop on rows such different row ripped out of m every iteration, works eg trickery of sumproduct((c=10)*row(m)).

but when index involved, fails work.

i noticed else not make sense. can write =sum(index(m,row(m),0)). returns sum of first row. can copy same formula array formula , find sum of each row. great (-ish). in theory, should therefore able write =sumproduct(sum(index(m,row(m),0))) sum of sums. fails again. same problem above.

any suggestion appreciated. thanks.

ps: in reality v dynamically computed based on column criteria.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -