Dynamic Array Formulas: Spill Results and Stop Copying Down

A dynamic array formula writes its result into as many cells as the result needs, from a single cell. When the source data changes, the result resizes itself. This removes the copy-down step, which is where most spreadsheet errors begin. The trade-off is that the formula depends on a recent spreadsheet version, and a single blocked cell can stop it from working.

Definitions and scope

SOP 1.1: What a dynamic array formula does

A dynamic array formula returns more than one value. Entered in one cell, it fills a block of adjacent cells below and to the right of that cell. The cell holding the formula is the anchor cell. The block it fills is the spill range.

Under the older method, a formula returned one value, so a list of 1,200 results needed 1,200 copies of the formula. Each copy had to be filled down by hand, and each was a separate point of failure.

SOP 1.2: Glossary of terms

TermDefinition
Anchor cellThe cell containing the dynamic array formula. Results start here.
Spill rangeThe block of cells the formula populates. Its size is set by the result.
Spill operator (#)A suffix, written as A1#, that refers to the whole spill range of the cell A1.
Implicit intersection (@)Older behaviour in which a formula returns one value from a range, shown with an @ sign.
Legacy arrayA pre-2019 array formula entered with Ctrl+Shift+Enter and shown in braces { }.
Calculated columnA formula that fills an entire column of an Excel Table automatically.
Blocked rangeAny non-empty cell inside the intended spill range. It causes a #SPILL! error.

SOP 1.3: Platform availability

Excel 365, Excel 2024 and Excel 2021 support dynamic arrays. Excel 2019 and earlier do not. Excel for the web supports them, and so does Excel for Mac in current versions.

Google Sheets has supported spilling for its core array functions for several years. It uses the same general logic but a different error message and a different reference syntax. Module 6 covers the differences.

Binsight Inventory Spreadsheet

Skip the setup

Binsight Inventory Spreadsheet

Stock in, stock out and reorder alerts that turn red before you run out. Uses lookups and conditional formatting.

See it on Taskdale →

How spilling works

SOP 2.1: Sizing the spill range

Excel calculates the result first, then measures it. If a formula returns a 1,200-row by 1-column array, the spill range is 1,200 rows by 1 column, starting at the anchor cell. The size is not fixed in the formula. It is decided each time the sheet recalculates.

This is why dynamic arrays suit data that grows. A formula does not need to know how many rows exist. It returns whatever the data produces.

SOP 2.2: Referring to a spill range with the # operator

Other formulas can point at the whole spill range by adding # after the anchor cell. If G2 spills 1,200 values, then G2# refers to all 1,200. The reference updates when the spill grows or shrinks.

Use G2# instead of a fixed range such as G2:G1201. A fixed range keeps its old size after the data changes, and the mismatch causes wrong totals without any error message.

SOP 2.3: Reading the @ sign

When a file built in an old version is opened in a current version, some formulas gain an @ sign, for example =@A2:A100. This means implicit intersection: the formula takes the value from the same row as the formula cell, as it did before.

Do not remove the @ sign without checking the result. Removing it changes a single-value formula into a spilling one, and the spill may collide with other data. For new formulas, the @ sign should not appear unless the function requires it.

Choosing between copy-down, spill, table and Power Query

Four methods cover most cases where a column of results is needed. Each has a different maintenance cost.

SOP 3.1: Decision matrix

AttributeCopy-down helper columnSingle dynamic formulaExcel Table calculated columnPower Query
New rows handled automaticallyNo, the fill must be extendedYes, if the formula references the data by row count or whole columnYes, the column fills itselfYes, on refresh
Edit one result without affecting othersYesNo, the spill is one unitYes, but it is still a column formulaNo
Works with older Excel versionsYesNo, Excel 2019 and earlier do not support itYesYes, from Excel 2016
Works inside an Excel TableYesNo, spills cannot enter a TableYes, this is its purposeNot applicable
Suits results that feed other formulasModerateStrongModerateWeak, needs a refresh
Recalculation behaviourEach row recalculates as editedWhole result recalculates when any input changesEach row recalculates as editedOnly on refresh

SOP 3.2: Decision rule

Use the following rule to select a method.

  1. If the file must open in Excel 2019 or earlier, use copy-down or a Table calculated column.
  2. If the data is a Table, use a calculated column for row-level values and a standard formula for summaries.
  3. If the result is a list built from a source range, and the file is used only in current versions, use a single dynamic formula.
  4. If the transformation involves merging files, cleaning text or reshaping large data, use Power Query.

Worked example

The following example builds a revenue summary from a sales log. It shows the old method, the new method, and a check that the two agree.

SOP 4.1: Source data

The sales log sits on the sheet named Sales, in columns A to E, with a header row and 1,200 data rows (rows 2 to 1201).

ColumnHeaderContent
ADateTransaction date
BRegionNorth, South, East or West
CRepSales representative name
DUnitsUnits sold on the line
EUnit pricePrice per unit

SOP 4.2: Old method, line revenue by copy-down

Under the older method, the revenue for each line sits in column G. G2 contains =D2*E2, and the formula is filled down to G1201.

This works until a 1,201st transaction is added. The new row has no formula in column G, so the revenue is blank, and any total that uses column G silently excludes it. The error is easy to miss because nothing displays as an error.

SOP 4.3: New method, line revenue in one formula

Enter the following in G2 only:

=LET(last,COUNTA(A:A),D2:INDEX(D:D,last)*E2:INDEX(E:E,last))

Here, COUNTA(A:A) counts the header and the 1,200 rows, giving 1,201. This equals the last row number because the sheet has no gaps. INDEX converts that number into the end of the range, so the multiplication covers rows 2 to 1201. The result spills 1,200 values into G2:G1201.

When a 1,201st transaction is added in row 1202, the count becomes 1,202 and the spill extends to G1202 without any edit.

Column G should have a header in G1, such as Line revenue. The header is outside the spill range, so it does not block it.

SOP 4.4: Region list

In I2, enter:

=LET(last,COUNTA(A:A),SORT(UNIQUE(B2:INDEX(B:B,last))))

This returns the four distinct regions in alphabetical order, spilling into I2:I5. Nothing else should sit in I3:I5, or the formula returns #SPILL!.

SOP 4.5: Revenue by region

In J2, enter:

=LET(last,COUNTA(A:A),SUMIFS(G2#,B2:INDEX(B:B,last),I2#))

G2# refers to the 1,200 line values. I2# supplies the four region names as criteria, so SUMIFS returns four totals, spilling into J2:J5. Each total sits beside its region.

SOP 4.6: Verification check

Enter the following in a spare cell to confirm the spill covers every data row:

=ROWS(G2#)=COUNTA(A:A)-1

The formula returns TRUE when the number of spilled rows equals the number of data rows. A FALSE result means the spill is out of step with the data, usually because of a blank row in the middle of the log. Module 7 covers blank rows.

Small Business CEO Dashboard

Ready-made template

Small Business CEO Dashboard

Sales, costs, cash and targets on one screen. The formulas are already built, so you type the numbers and the dashboard does the rest.

See it on Taskdale →

Common mistakes and #SPILL! errors

SOP 5.1: Blocked spill range

The most common error is #SPILL!, which means a cell in the intended spill range is not empty. The fix is to clear the blocking cell, or move the formula. Excel does not overwrite existing data.

Look for stray notes, formatting that contains values, or a second formula that has spilled into the same area. The Excel error tooltip highlights the blocking cell.

SOP 5.2: Spilling inside an Excel Table

A dynamic array formula cannot spill inside an Excel Table. It returns #SPILL! if the spill range would extend into a Table. Use a calculated column instead, which fills automatically and keeps the Table’s structure.

Spilled formulas can still sit outside a Table and reference the Table’s columns. The rule is only about where the spill lands.

SOP 5.3: Editing one cell of a spilled result

A spilled cell cannot be edited or deleted on its own. Attempting to do so returns an error, because the whole block belongs to the anchor formula. To change one value, change the source data or wrap the formula in a function that overrides the result.

This is a real limitation for hand-curated lists. A list that needs manual corrections should be a static list, or a dynamic formula with the corrections placed in a separate column.

SOP 5.4: Mismatched sizes in array operations

When two arrays of different lengths are combined, the result is #N/A in the mismatched positions or a #VALUE! error, depending on the function. This happens often when one range is written as B2:B1201 and another as B2:B1205 after a row is added.

Use the same reference pattern for every range in one formula. The INDEX and COUNTA pattern in Module 4 keeps all ranges synchronised, as long as they begin at the same row.

SOP 5.5: Volatile functions

Some functions recalculate every time any cell changes. These include RANDARRAY, OFFSET, INDIRECT, NOW and TODAY. A dynamic array that uses RANDARRAY will regenerate its results on each edit, which is useful for simulations but disruptive for reports.

Avoid OFFSET and INDIRECT where INDEX can do the same job. INDEX is not volatile, and it is easier to audit.

SOP 5.6: Old-version recipients

A file with dynamic array formulas opened in Excel 2019 shows the formula as a legacy array, often with braces and @ signs, and the results may not spill. The file still calculates the first value correctly, which can lead to a quiet error where only the top cell is right.

Before sending a file to people on older versions, check the output in one of those versions. Alternatively, replace the dynamic formula with a Table calculated column.

Trade-offs, costs and platform differences

SOP 6.1: Version and licence cost

Dynamic arrays require a current Excel version. For an organisation on a subscription plan, this is normally included. For someone holding a one-off licence of an older version, the feature may require an upgrade, which has a cost and a planning lead time. Confirm the licence type before building a workbook around the feature.

SOP 6.2: Performance on large data

Dynamic array formulas are efficient on large ranges, but a formula that returns a large spill, combined with volatile functions, slows recalculation. Using whole-column references such as A:A inside FILTER or SUMIFS across many formulas multiplies the cost. The COUNTA pattern used in Module 4 uses whole-column references once per formula, which is acceptable at this scale. For data above several hundred thousand rows, Power Query or a database is the better tool.

SOP 6.3: Google Sheets

Google Sheets spills results from FILTER, UNIQUE, SORT and SEQUENCE automatically. There is no spill operator. The equivalent of G2# is a fixed or named range, so the reference must be updated manually or defined with INDEX or a named range that expands.

Sheets reports a blocked spill as #REF! with the message “Array result was not expanded because it would overwrite data in” followed by the cell address. The fix is the same as in Excel: clear the cells named in the message.

Sheets still uses ARRAYFORMULA for some older patterns, particularly where a function does not accept arrays. Wrapping a dynamic formula in ARRAYFORMULA is usually unnecessary, and it can produce duplicated output.

Decision checklist

Use this checklist before building or reviewing a dynamic array formula.

  • Confirm every recipient uses Excel 2021, Excel 2024, Excel 365 or Google Sheets.
  • Confirm the spill range is clear of data and that no formula sits below or to the right of the anchor.
  • Confirm the formula does not sit inside an Excel Table.
  • Use INDEX with COUNTA or a named range rather than fixed row numbers.
  • Refer to spilled results with the # operator in Excel, or a named range in Google Sheets.
  • Run the row-count check, such as =ROWS(G2#)=COUNTA(A:A)-1, after each data change.
  • Avoid volatile functions unless the output must change on every recalculation.
  • Keep one spill per anchor, and leave a blank row or column between separate spills.
  • Test the workbook with an added row and an empty filter result before handing it over.
Lapis Ledger Annual Budget

Get the finished file

Lapis Ledger Annual Budget

Monthly and annual budget tabs for Excel and Google Sheets, with category totals that add themselves up.

See it on Taskdale →

Scroll to Top