Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

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.

share|improve this question

migrated from superuser.com Dec 20 '13 at 4:18

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

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

1 Answer 1

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.