Returns the logarithm of a number to a specified base.
ฟังก์ชันนี้ทำงานใน Google Sheets เหมือนกับใน Excel — ไวยากรณ์และอาร์กิวเมนต์เดียวกัน
LOG(number, [base])The LOG function calculates the logarithm of a positive number based on a provided base. If the base argument is omitted, Excel defaults to a base of 10.
=LOG(100, 10)ผลลัพธ์: 2
Calculates the base-10 logarithm of 100, which is 2.
=LOG(8, 2)ผลลัพธ์: 3
Calculates the base-2 logarithm of 8, which is 3.
The function will return a #NUM! error because logarithms are only defined for positive numbers.