Returns the number of columns in a reference or array.
ฟังก์ชันนี้ทำงานใน Google Sheets เหมือนกับใน Excel — ไวยากรณ์และอาร์กิวเมนต์เดียวกัน
COLUMNS(array)The COLUMNS function counts the total number of columns within a specified range or array. It is commonly used to determine the width of a dataset or to create dynamic references in complex formulas.
=COLUMNS(A1:C5)ผลลัพธ์: 3
Returns 3 because the range A1:C5 spans three columns (A, B, and C).
No, the COLUMNS function expects a single reference or array and will return an error if multiple non-contiguous ranges are provided.