ID EN
#Dynamic array

MAKEARRAY

Excel Functions 🇮🇩 Bahasa Indonesia

Buat array dengan nilai terhitung

Syntax

EXCEL
=MAKEARRAY(rows, columns, function)

Arguments

Parameter Deskripsi
rows The number of rows to create.
columns The number of columns to create.
function The custom LAMBDA calculation to apply.

Return Value

Serangkaian nilai terhitung

Details

Fungsi MAKEARRAY mengembalikan larik dengan baris dan kolom tertentu, berdasarkan penghitungan LAMBDA khusus. MAKEARRAY dapat digunakan untuk membuat array dengan dimensi variabel yang dihitung. Sintaks umum untuk MAKEARRAY terlihat seperti ini: Fungsi MAKEARRAY memerlukan tiga argumen: baris, kolom, dan fungsi. Baris adalah jumlah baris yang akan dibuat, dan kolom adalah jumlah kolom yang akan dibuat. Fungsinya adalah LAMBDA khusus (lihat di bawah) untuk digunakan saat membuat nilai dalam array. Jumlah total nilai dalam array yang dikembalikan oleh MAKEARRAY akan sama dengan baris * kolom. MAKEARRAY menggunakan fungsi LAMBDA untuk menerapkan fungsi yang digunakan untuk menghitung nilai array. Struktur LAMBDA yang digunakan MAKEARRAY adalah: dimana r mewakili jumlah baris, c mewakili jumlah kolom aslinya

Contoh

Example 1

The MAKEARRAY function returns an array with specified rows and columns, based on a custom LAMBDA calculation. MAKEARRAY can be used to create arrays

EXCEL
=MAKEARRAY(rows,columns,function)
LAMBDA structure

The MAKEARRAY uses the LAMBDA function to apply the function used to calculate array values. The structure of the LAMBDA used by MAKEARRAY is:

EXCEL
LAMBDA(r,c,calculation)
Examples

In the formula below, MAKEARRAY is used to create an array with 2 rows and 3 columns, populated with the result multiplying rows by columns:

EXCEL
=MAKEARRAY(2,3,LAMBDA(r,c,r*c)) // returns {1,2,3;2,4,6}
Examples

The result is a 2 x 3 array with six values {1,2,3;2,4,6}. The calculation can be a hardcoded value as well. Below are examples of the same formula, w

EXCEL
=MAKEARRAY(2,3,LAMBDA(r,c,0)) // returns {0,0,0;0,0,0}
=MAKEARRAY(2,3,LAMBDA(r,c,"x")) // returns {"x","x","x";"x","x","x"}
Random values

MAKEARRAY can be used to generate random values. In the formula below. The CHAR function is used with the RANDBETWEEN function to generate random uppe

EXCEL
=MAKEARRAY(2,3,LAMBDA(r,c,CHAR(RANDBETWEEN(65,90))))

See Also

LAMBDA LET MAP SCAN REDUCE MAKEARRAY BYCOL BYROW