HSTACK Function in Microsoft Excel: Syntax, Examples & Compatibility
Learn how to place separate ranges side by side to create one wider array in Microsoft Excel. Includes syntax, two verified-by-reasoning results, troubleshooting and portability notes.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: place separate ranges side by side to create one wider array in Microsoft Excel. The reproducible examples below use explicit values so the formula’s meaning is testable without a large workbook.
Evidence: The function name and syntax are documented in the linked vendor function reference. Expected outputs were independently reasoned or checked outside the application. These are not native Microsoft Excel test results. A guide being published here does not certify every software release or file-import scenario.
Availability and version history
- Introduced: Preview announced March 16, 2022: Windows Beta 2203 (15104.20004), Mac 16.60 (22030400). Web and Microsoft 365 Current Channel deployment reported September 29, 2022. Release history.
- Availability: Official help lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac.
- Checked: October 14, 2026; official HSTACK reference. Documentation check, not a new native test; existing example-verification notes retain their scope.
Syntax and arguments
=HSTACK(array1, [array2], ...)
Supply one or more arrays. Additional arrays are appended to the right of the preceding arrays; only the first argument is required.
Best use case: Place separate ranges side by side to create one wider array.
Set up the example sheet
Enter A2=Pen, A3=Pad, C2=12, and C3=5. Keep a two-row by two-column output region clear before entering each formula; the examples return four cells.
Enter the formula in an unused cell. For a formula returning several values, leave an unobstructed area where those values can expand. These formulas use comma argument separators in a typical English-language locale; commas or semicolons inside quoted text are data, not argument separators. Adapt the separator if your regional settings require it.
Worked example 1: HSTACK with known input
=HSTACK(A2:A3,C2:C3)
Expected output: two rows: Pen, 12 and Pad, 5.
The left source column is placed beside the right source column.
Worked example 2: a second HSTACK case
=HSTACK(C2:C3,A2:A3)
Expected output: two rows: 12, Pen and 5, Pad.
Reversing the arguments reverses the placement of the source ranges.
Compare both results before replacing literal values or short sample ranges with your own workbook data. For a spilling formula, compare every output cell, not only the top-left result.
Unequal-height example and error handling
Using the same input cells, enter:
=HSTACK(A2:A3,C2)
The expected two-by-two output is Pen, 12 on the first row and Pad, #N/A on the second. C2 supplies only one row, so Excel pads the missing second position. This padding is an error value, not literal text.
=IFERROR(HSTACK(A2:A3,C2),"") replaces that padding with empty text. It also replaces any genuine source error, so use it only when concealing those errors is acceptable. Neither formula attaches headers or joins records by a key. The arrays are aligned by position.
These outputs follow the official HSTACK dimensions and padding rules and were independently calculated; they were not run in Excel.
Practical advice and troubleshooting
When this formula helps: HSTACK is useful for assembling export-ready tables without writing back into the original cells.
Important edge case: In Excel, unequal input heights are padded with #N/A in the shorter arrays. The output height is the largest input height, and its width is the sum of the input widths.
If the result differs, first verify the text-versus-number types of the input cells, the argument separators for your locale, and the range size. For dynamic arrays, inspect occupied cells in the output area. An error that looks like a missing function may reflect a software version rather than incorrect data.
Compatibility and version considerations
Do not assume formatting or headers are copied into array results. HSTACK combines values and follows spill rules.
Modern dynamic-array Excel and current Google Sheets list HSTACK; it is not a safe choice for Excel 2013.
Function availability and parameter behavior must be judged for the specific application and release; a function documented in one spreadsheet does not automatically work in another.
Related guides and official documentation
-
Microsoft Excel documentation for HSTACK — function syntax and current vendor information.
Editorial verification: Vendor catalogue referenced as of 2026-10-12. The two example outputs are independently reasoned; no native application run, screenshot, or version-specific output is claimed. Review the editorial testing standards if you require stronger proof before importing a workbook.