2

In Google Sheets, I have the following data:

   |   A |  B  |  C  |  ...  | G  | TOTALS   
 1 |  100|  200|  400|  ...  | 870| =PRODUCT(A1:G1)  |
 2 |  120|  240|  360|  ...  | 232| =PRODUCT(A2:G2)  |
 3 |  125|  425|  100|  ...  | 509| =PRODUCT(A3:G3)  |

How can I create the TOTALS column using ARRAYFORMULA?

player0
  • 124,011
  • 12
  • 67
  • 124
Silva
  • 23
  • 5

3 Answers3

1

try:

=INDEX(IFERROR(1/(1/QUERY(QUERY(
 IF(LEN(TRIM(FLATTEN(QUERY(TRANSPOSE(A1:G10),,9^9)))), 
 IF(A1:G10="", 1, A1:G10*1), 0), 
 "select Col"&JOIN("*Col", COLUMN(A:G))), 
 "offset 1", 0))))

enter image description here

player0
  • 124,011
  • 12
  • 67
  • 124
1

shorter and should be faster (with some tweaking for sure):

=INDEX(IFERROR(1/(1/DPRODUCT(TRANSPOSE({A1:A*0, A1:G}), 
 SEQUENCE(ROWS(A1:A)), {IF(,,); IF(,,)}))))

enter image description here

player0
  • 124,011
  • 12
  • 67
  • 124
0

or simply:

=INDEX(A:A * B:B * C:C * D:D * E:E * F:F * G:G)

enter image description here

player0
  • 124,011
  • 12
  • 67
  • 124