FormulaCraft

EXPAND

EXPAND grows an array to specified dimensions, filling any added rows or columns with a pad value you choose (defaulting to #N/A). It is useful when you need all arrays in a calculation to be the same size before combining them with functions like HSTACK or VSTACK. Available in Excel 365 and Google Sheets.

Excel
=EXPAND(A2:B3,4,2,0)
Google Sheets
=EXPAND(A2:B3,4,2,0)

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

How it works

  1. 1A2:B3 is the source array — it is 2 rows by 2 columns.
  2. 24 is the target number of rows; 2 is the target number of columns.
  3. 30 is the pad value used to fill the 2 extra rows that are added below the original data.

Need a version for your data?

Try: “Pad a small 2x2 range out to 4 rows keeping 2 columns and filling extras with zero

Related

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: