ExcelExcel 2024+
HSTACK function in Excel
Appends arrays horizontally and in sequence to return a larger array
=HSTACK(array1, [array2], ...)HSTACK syntax and parameters
Two arguments, one required.
- array1arrayRequired
- array2arrayRepeating
HSTACK examples
Formulas you'll actually reuse.
Customer and Amount side by side, skipping the column between them:
=HSTACK(A2:A50, C2:C50)Add a running row number as the first column:
=HSTACK(SEQUENCE(ROWS(A2:B50)), A2:B50)
HSTACK in Google Sheets
Same name — your formula ports as-is.
Try HSTACK in the playground
Edit the example — nothing to install.
Preloaded with the HSTACK formula from Example 1 — change anything and watch it respond.
Loading the editor…
HSTACK errors
What they mean — and the fixes.
#N/AThe arrays have different heights — HSTACK pads the shorter one with #N/A; wrap the result in IFERROR(…, "") to blank them.
Related functions
More ways Excel gets this done.
- ADDRESSReturns a reference as text to a single cell in a worksheetLookupGoogle Sheets
- AREASReturns the number of areas in a referenceLookupNo Google Sheets equivalent
- CHOOSEChooses a value from a list of valuesLookupGoogle Sheets
- CHOOSECOLSReturns the specified columns from an arrayLookupGoogle Sheets
- CHOOSEROWSReturns the specified rows from an arrayLookupGoogle Sheets
- COLUMNReturns the column number of a referenceLookupGoogle Sheets