Google Sheets HSTACK: Combine Tables Horizontally Side-by-Side
HSTACK appends arrays and ranges horizontally side-by-side in sequence, merging columns from separate sources into a single unified table.
=HSTACK(array1, [array2, ...])Technical Overview & Engine Mechanics
Formula Comparison: HSTACK vs. Alternatives
Formula Parameters & Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
| array1 | Range | Required | Primary table range. |
| array2 | Range | Optional | Secondary range placed to the right of array1. |
Real-World Spreadsheet Examples
Explore verified operational formulas used in enterprise reporting and database workflows:
Example 1: Merge Client Names with Automated Score Calculations
=HSTACK(A2:B100, MAP(C2:C100, D2:D100, LAMBDA(s, c, s*c)))Example 2: Stitch Non-Adjacent Columns from Master Sheet
=HSTACK(Sheet1!A:A, Sheet1!G:G, Sheet1!Z:Z)Example 3: Join Dates with Daily FX Rates
=HSTACK(A2:A30, GOOGLEFINANCE("CURRENCY:EURUSD", "price", DATE(2026,1,1), 30))Example 4: Combine Customer Profiles with Order Totals Side-by-Side
=HSTACK(Customers!A2:B100, Orders!D2:D100, Orders!G2:G100)Example 5: Attach Dynamic Line Numbering to Filtered Data
=LET(data, FILTER(A2:D100, D2:D="Active"), HSTACK(SEQUENCE(ROWS(data)), data))Common Errors & Solutions
Performance Pro Tips
- Combine with CHOOSEROWS to align table headers cleanly.
Frequently Asked Questions: HSTACK
Can HSTACK combine single cells with entire columns?
No, row counts must match. To broadcast a single cell down an array, use ARRAYFORMULA or MAP.
How many arrays can I stack horizontally with HSTACK?
You can stack dozens of ranges up to the 10 million total cell ceiling of Google Sheets.
Does HSTACK work across different sheets?
Yes. You can reference ranges across any tab in your workbook.
Is HSTACK faster than array literals {A, B}?
Performance is comparable, but HSTACK is more legible and less error-prone when passing function outputs.
Is HSTACK compatible with Excel 365?
Yes. Excel 365 supports identical HSTACK syntax.
Related Google Sheets Formulas
QUERY
The QUERY function is Google Sheets' most versatile formula, executing a SQL-like Google Visualization API Query Language string across spreadsheet tables to filter, aggregate, group, pivot, and sort data in a single formula.
Data TransformationARRAYFORMULA
ARRAYFORMULA enables single spreadsheet formulas to output an entire matrix or column of calculated results automatically. When new rows are entered, ARRAYFORMULA calculates them instantly without requiring manual formula dragging.
Data TransformationFILTER
FILTER dynamically outputs only the rows or columns from a source range that satisfy one or more logical conditions. As source data updates, filtered results re-calculate automatically.