Home > Back-end >  How do I use an array formula to sum a range of columns?
How do I use an array formula to sum a range of columns?

Time:12-14

I'm trying to figure out how to use array formulas in Excel 365. Here's a very simple situation I'm starting with. I have an array of values, and I want to get the sum of the values in each row. In reality, I have 2000 rows, and 600 columns, but to simplify let's say I just have the following:

enter image description here

I want to put the sums in the 3rd column (just 6, 60, 600) using an array formula. I know I can just enter a simple formula for one row and copy it down, but I'm interested in seeing how this is done with an array formula so I can just enter a single formula. What I want to do will get more complicated after that, but I want to start with this.

(I'm an experienced Excel user, but I haven't worked much with array formulas in Excel 365.)

CodePudding user response:

Use BYROW/LAMBDA:

=BYROW(C2:E4,LAMBDA(a,SUM(a)))

enter image description here

Another option is MMULT

=MMULT(C2:E4,SEQUENCE(COLUMNS(C2:E4),,1,0))

enter image description here

  • Related