# How to use ARRAYFORMULA and SUM together to get a column with the sum of the proceeding rows

In Google Sheets, I have the following data:

|   A |  B  |  C  |  ...  | N  | TOTALS       |
1 |  123|  425|  324|  ...  | 234| =SUM(A1:N1)  |
2 |  123|  425|  324|  ...  | 234| =SUM(A2:N2)  |
3 |  123|  425|  324|  ...  | 234| =SUM(31:N3)  |

How can I create the TOTALS column using ARRAYFORMULA?

ARRAYFORMULA(SUM(A1:C99)) will give a single number, the sum of all the cells — that’s not what I want.

-

## migrated from superuser.comDec 20 '13 at 4:18

This question came from our site for computer enthusiasts and power users.

Best practice is to accept and/or upvote an answer. – Jacob Jan Tuinstra Dec 19 '13 at 16:14

Use the following formula to do that.

## Formula

=MMULT(B2:E4,TRANSPOSE(ARRAYFORMULA(COLUMN(B2:E4)^0)))

## Explained

The ARRAYFORMULA is meant to return the complete range, as set by the COLUMN formula. The ^0 (power of zero) will always return 1. Therefore each result is multiplied by 1 (yielding the same value) and summed.

## Example

I've created an example file for you: SUM OVER ROWS

-
Thanks, that is really convoluted ! – Yisrael Dov Dec 19 '13 at 15:58
@YisraelDov, remember to mark the answer as accepted if it was what you were looking for. – Alex Dec 2 '14 at 9:04

How about manually summing the columns:

=arrayformula(A:A + B:B + C:C)
-