Sum Each Row of a Dynamic Excel Array with MMULT
Question details
Calculate a separate total for each row of a dynamic array created with SEQUENCE.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A user wants to replace a longer SUMIF approach with a formula that sums each row of a spilled array.
- Observed behavior
- The longer SUMIF approach works, but a consolidated formula produces an error or is displayed as text.
Confirm that your Excel version supports dynamic arrays and that the source formula spills from A1. Make sure the source array contains numeric values and leave enough empty cells for the row totals to spill.
Use MMULT to sum each row of the spilled array
Use this formula to return one total per row and automatically follow changes to the source spill range.
A1# refers to the entire array spilled from A1. SEQUENCE(COLUMNS(A1#))^0 creates a column of ones with the same number of rows as the source array has columns, allowing MMULT to sum each source row.
Click an empty cell outside the source spill range, with enough blank cells below it for the results.
Type =MMULT(A1#,SEQUENCE(COLUMNS(A1#))^0) in the formula bar and press Enter. If your source spill starts elsewhere, replace both occurrences of A1 with its starting cell.
Review the spilled totals below the formula cell. Each result corresponds to one row of the source array.
Fix an Excel formula displayed as text
Use these checks when Excel shows the formula itself instead of calculating row totals.
Calculate row totals in WPS Spreadsheet
Open your workbook in WPS Spreadsheet and use MMULT to sum each row of a spilled numeric array in a version that supports SEQUENCE and spill references.
- 1. Open the workbook: In WPS Spreadsheet, select Open and choose your Excel workbook.
- 2. Check the source array: Locate the numeric array spilling from A1, or note the starting cell of your own spilled array.
- 3. Enter the formula: Select an empty cell outside the source array, enter =MMULT(A1#,SEQUENCE(COLUMNS(A1#))^0), and press Enter. Replace both A1 references if your source starts in a different cell.
- 4. Review the totals: Check that one result appears for each source row. If your WPS version does not support the spill-reference syntax, use =SUM(A1:D1) for a four-column source and fill it down, adjusting the range as needed.

Frequently Asked Questions
What does A1# mean in the formula?
A1# refers to the entire dynamic array spilled from the formula in A1. Replace A1 with the starting cell of your source spill.
Why does the MMULT formula use a sequence of ones?
SEQUENCE(COLUMNS(A1#))^0 produces a column of ones with one entry for each source column. MMULT multiplies each source row by that column to produce a row total.
Why is Excel displaying my formula instead of the result?
Select the cell and choose Home > Number Format > General, then re-enter the formula without a leading apostrophe. If formulas appear throughout the worksheet, turn off Formulas > Show Formulas.
What should I do if the row-total formula returns #SPILL!?
Clear any cells blocking the output range below the formula cell. Also place the formula outside the source array's spill range.
Will the totals update when the source array changes size?
Yes. The A1# reference follows the source spill, and the formula returns a total for each current row, provided the output range has enough empty cells.




