Search code examples
google-sheetsspreadsheet

Google Spreadsheets sum formula simplification


I have this formula:

=ARRAYFORMULA(IF(A4:A<>"", P4:P + Q4:Q + R4:R + S4:S + T4:T + U4:U + V4:V + W4:W, ""))

I wanted to simplify it in order not to write P4:P + Q4:Q + R4:R + S4:S + T4:T + U4:U + V4:V + W4:W one by one, it is really ugly and a manual work. Asked ChatGPT to simplify it, but it failed, do you you have a solution?


Solution

  • Replace that part of the formula with this:

    byrow(P4:W,lambda(Σ,sum(Σ)))