How to Sum Each Row in Google Sheets

This post explains how to get a total column in Google Sheets using an array formula. You can sum each row in Google Sheets using functions like SUM, MMULT, QUERY, DSUM, or even the + operator.

There’s also a modern way to do this using LAMBDA functions. So, creating a dynamic total column per row has become easier than ever.

To sum values, many users reach for the SUM function. However, while SUM accepts arrays, it does not return a dynamic array result (i.e., it won’t spill results down a column). To sum each row in Google Sheets dynamically, we need to explore other methods.

I’ll use function combinations in this tutorial. If you’re unfamiliar with any function used, please refer to my Google Sheets Functions Guide.

How to Get a Total Column in Google Sheets Manually

To sum each row manually, enter this formula in cell I2 and drag it down:

=SUM(C2:H2)
Manual row-wise summing in Google Sheets using the SUM function with a dragged formula

This method works but is not dynamic. If your dataset grows, you’ll need to copy the formula again. It’s not ideal for dashboards or automated workflows.

Sum Each Row Using BYROW

To get a total column in Google Sheets that spills automatically, use BYROW:

=VSTACK("Total", BYROW(C2:H, LAMBDA(r, IF(COUNTA(r)=0,, SUM(r)))))

Enter this formula in I1.

Explanation:

  • LAMBDA(r, IF(COUNTA(r)=0,, SUM(r))): Custom LAMBDA function that sums each row unless it’s empty.
  • BYROW: Applies the LAMBDA to every row in C2:H.
  • VSTACK: Adds a header row to the result.

This is a clean and dynamic solution to sum each row in Google Sheets.

Sum Each Row Using MMULT

To get a total column using matrix multiplication, try this formula in I1:

=ARRAYFORMULA(LET(
     header, "Total",
     result, MMULT(N(C2:H), TRANSPOSE(SIGN(COLUMN(C2:H)))),
     VSTACK(header, IF(result=0,, result))
))

Explanation:

  • N(C2:H): Converts values to numbers (treats blanks as 0).
  • TRANSPOSE(SIGN(COLUMN(C2:H))): Creates a column of 1s to multiply with.
  • MMULT: Performs matrix multiplication to sum across each row.
  • LET: Improves readability by naming parts.
  • IF(result=0,, result): Replaces zeros with blanks to suppress them in the output.

This formula is flexible and adjusts when you add rows and insert columns.

Sum Each Row Using DSUM

DSUM is less common but powerful. Enter this formula in I1:

=ARRAYFORMULA(LET(
     result, DSUM(TRANSPOSE(HSTACK(CHOOSECOLS(C2:H, 1), C2:H)), SEQUENCE(COLUMNS(C2:H)), {IF(,,); IF(,,)}),
     VSTACK("Total", IF(result=0,, result))
))

Explanation:

  • DSUM typically returns column totals, but by transposing the data, we turn them into row totals.
  • HSTACK and CHOOSECOLS: Prepares the input format.
  • VSTACK: Adds the “Total” header.

Limitations of Non-Dynamic Alternatives

The three solutions above adjust to inserted rows or columns. But some simpler methods don’t. For example:

Sum Each Row Using QUERY

=ARRAYFORMULA(LET(
     result, QUERY(N(C2:H), "SELECT Col1+Col2+Col3+Col4+Col5+Col6 LABEL Col1+Col2+Col3+Col4+Col5+Col6 'Total'", 0),
    IF(result=0,, result)
))
  • QUERY is readable but not dynamic. If you insert a column between C and H, the formula returns incorrect results.
  • Use N(C2:H) to convert blanks to 0.

Note: While we can make QUERY dynamic, it complicates the formula significantly.

Sum Each Row Using the ‘+’ Sign

=ARRAYFORMULA(LET(
     result, C2:C + D2:D + E2:E + F2:F + G2:G + H2:H,
     VSTACK("total", IF(result=0,"", result))
))

This is easy to read but must be manually updated if columns are added or removed. Like QUERY, it’s not ideal for dynamic reports.

Summary: Best Ways to Sum Each Row in Google Sheets

To sum each row in Google Sheets dynamically and efficiently:

  • Use BYROW with LAMBDA for clean and readable code.
  • Use MMULT for a matrix-based, flexible approach.
  • Use DSUM with transposition for advanced control (you can include criteria in this method if needed).

These formulas help you get a total column in Google Sheets that updates automatically with your data—perfect for dashboards and reporting.

Additional Resources

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Expert Prashanth KV is a Diamond Product Expert in Google Sheets, officially recognized by Google for his contributions to the Docs Editors Help Community and featured in the Google Product Experts Directory. Explore his blog to learn advanced formulas, automation tips, and problem-solving techniques to elevate your spreadsheet skills.

Calculate Trip Days by Month (Start, End, and Full Days) in Google Sheets

If you're managing business travel in Google Sheets, you may need to calculate how...

Mode of Comma-Separated Numbers in Excel (Dynamic Array)

There is no dedicated function in Excel to directly find the mode of comma-separated...

How to Find Mode of Comma-Separated Numbers in Google Sheets

Working with comma-separated numbers inside a single cell is a common scenario in Google...

How to Count Merged Cells in Google Sheets (and Get Their Size)

Sometimes, you may have blocks of merged cells in a column or row. But...

More like this

Calculate Trip Days by Month (Start, End, and Full Days) in Google Sheets

If you're managing business travel in Google Sheets, you may need to calculate how...

How to Find Mode of Comma-Separated Numbers in Google Sheets

Working with comma-separated numbers inside a single cell is a common scenario in Google...

How to Count Merged Cells in Google Sheets (and Get Their Size)

Sometimes, you may have blocks of merged cells in a column or row. But...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.