Data Transformation FormulaGoogle Sheets V8 Engine Verified

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.

Formula Syntax:=HSTACK(array1, [array2, ...])

Formula Parameters & Arguments

ArgumentTypeRequiredDescription
array1RangeRequiredPrimary table range.
array2RangeOptionalSecondary 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)))
How it works: Puts customer names side-by-side with calculated metrics.

Example 2: Stitch Non-Adjacent Columns from Master Sheet

=HSTACK(Sheet1!A:A, Sheet1!G:G, Sheet1!Z:Z)
How it works: Pulls ID, Status, and Final Total together without modifying master tab.

Example 3: Join Dates with Daily FX Rates

=HSTACK(A2:A30, GOOGLEFINANCE("CURRENCY:EURUSD", "price", DATE(2026,1,1), 30))
How it works: Generates parallel daily timeline analytics.

Common Errors & Solutions

❌ #VALUE! Mismatched row counts
Resolution: If arrays have different row counts, HSTACK pads the shorter array with #N/A.

Performance Pro Tips

  • Combine with CHOOSEROWS to align table headers cleanly.

Frequently Asked Questions

Does HSTACK recalculate automatically when data changes?

Yes. Google Sheets recalculates all dependent formulas immediately whenever referenced input cells are modified.

Is this formula compatible with Microsoft Excel?

Modern functions like XLOOKUP, FILTER, UNIQUE, SORT, and LET are natively supported in Excel 365. However, QUERY is unique to Google Sheets and uses the Google Visualization API syntax.

Related Google Sheets Formulas