ID EN
#Dynamic array

HSTACK

Excel Functions 🇮🇩 Bahasa Indonesia

Gabungkan rentang atau array secara horizontal

Syntax

EXCEL
=HSTACK(array1, [array2], ...)

Arguments

Parameter Deskripsi
array1 The first array or range to combine.
array2 [optional] The second array or range to combine.

Return Value

Rentang atau larik gabungan tunggal

Details

Fungsi HSTACK menggabungkan array secara horizontal menjadi satu array. Setiap larik berikutnya ditambahkan ke sebelah kanan larik sebelumnya. Hasil dari HSTACK adalah array tunggal yang tersebar ke lembar kerja menjadi beberapa sel. HSTACK berfungsi sama baiknya untuk rentang pada lembar kerja atau array dalam memori yang dibuat oleh rumus. Output dari HSTACK sepenuhnya dinamis. Jika data dalam array tertentu berubah, hasil dari HSTACK akan segera diperbarui. Gunakan HSTACK untuk menggabungkan rentang secara horizontal dan VSTACK untuk menggabungkan rentang secara vertikal. HSTACK menumpuk rentang atau array secara horizontal. Pada contoh di bawah, rentang B3:D3 digabungkan dengan rentang B6:C6. Setiap rentang/array berikutnya ditambahkan ke sebelah kanan rentang/array sebelumnya. Rumus di F3 adalah: Rentang dapat mencakup beberapa baris, seperti yang terlihat

Contoh

Basic usage

HSTACK stacks ranges or arrays horizontally. In the example below, the range B3:D3 is combined with the range B6:C6. Each subsequent range/array is ap

EXCEL
=HSTACK(B3:D3,B6:C6)
Basic usage

Ranges may include multiple rows, as seen below. The formula in F3 is:

EXCEL
=HSTACK(B3:B5,D3:D5)
Range with array

HSTACK can work interchangeably with both arrays and ranges. In the worksheet below, we combine the array constant {"Red";"Blue";"Green"} with the ran

EXCEL
=HSTACK({"Red";"Blue";"Green"},B2:B4)
Arrays of different sizes

When HSTACK is used with arrays of different sizes, the smaller array will be expanded to match the size of the larger array. In other words, the smal

EXCEL
=HSTACK(B5:B8,D5:D6)
Arrays of different sizes

By default, the cells used for padding will display the #N/A error. One option for trapping these errors is to use the IFERROR function. The formula i

EXCEL
=IFERROR(HSTACK(B5:B8,D5:D6),"")

See Also

VSTACK TRIMRANGE