Category: FUNCTION | Updated: 2026-11-22

How to Use the HSTACK Function in Google Sheets | Combine Multiple Tables Horizontally

What Is the HSTACK Function?

The HSTACK function places multiple cell ranges or arrays side by side horizontally to combine them into a single table. It is useful for building a new table from non-adjacent columns or comparing multiple summary tables side by side.

Syntax

=HSTACK(range1, [range2, ...])
  • range1: The first cell range or array to place on the far left.
  • range2, … (optional): Additional cell ranges or arrays to append to the right, in order.

Practical Examples

This example horizontally combines “Basic Info” (A1:B3) and “Rating” (D1:D3) into a single table starting at F1.

Row Col A (ID) Col B (Name) Col D (Rating) Formula in Col F Col F Col G Col H
1 ID Name Rating =HSTACK(A1:B3, D1:D3) ID Name Rating
2 001 Sato A (Auto-expanded) 001 Sato A
3 002 Suzuki S (Auto-expanded) 002 Suzuki S

Common Errors and Precautions

  • #N/A error (mismatched row counts): When combining ranges with different numbers of rows, #N/A errors pad the bottom of the shorter range. To hide these errors, wrap the formula in IFERROR, such as =IFERROR(HSTACK(A1:B5, D1:D3), "").
  • #REF! error (output collision): If cells to the right where the combined result expands already contain text or formulas, a #REF! error occurs. Keep the destination area clear.
  • Does not match rows by key (unlike VLOOKUP): HSTACK simply places the specified ranges side by side in order. If your rows are in different orders and need to be matched by an ID, use XLOOKUP or VLOOKUP instead.

Frequently Asked Questions

Q. What happens if I horizontally combine tables with different numbers of rows using HSTACK?

A. The total number of rows matches the tallest table, and #N/A errors appear below shorter tables. You can combine HSTACK with IFERROR to replace them with blanks.

Q. Can I place non-adjacent columns side by side using HSTACK?

A. Yes. Writing '=HSTACK(A1:A10, D1:D10)' skips columns B and C and creates a new table with columns A and D side by side.