I know how to use byrow, choosecols and lambda etc to sum up columns.
e.g. =BYROW(CHOOSECOLS(B2:M3,1,2,3,4,5,6),LAMBDA(a,SUM(a)))
I would like to sum up columns but the columns to be summed up would be different in each row depending on a a cell in that row
e.g. in row 1, I want to sum up columns 1,2,3,4 but in row 2 I want to sum up 5,6,7,8,9,10,11 and 12
I was thinking something along the lines of:
=BYROW(b2:m3,LAMBDA(a,SUM(CHOOSECOLS(a,TEXTSPLIT(A2,”,”))))) where A2 would have 1,2,3,4 and A3 would have 5,6,7,8,9,10,11,12
However this does not work
Is this possible?
andy leary is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.