LibreOffice Calc formulas

If you're looking for a list of commonly used LibreOffice Calc formulas, here are some of the most useful ones:
Purpose | Formula | Example |
|---|---|---|
Sum |
| Adds values in A1–A10 |
Average |
| Calculates the average |
Count numbers |
| Counts cells containing numbers |
Count non-empty |
| Counts non-empty cells |
Maximum |
| Returns the largest value |
Minimum |
| Returns the smallest value |
If condition |
| Returns "Yes" if A1 > 10 |
Logical AND |
| TRUE if both conditions are true |
Logical OR |
| TRUE if either condition is true |
Lookup |
| Finds A1 in first column and returns second column |
Modern lookup |
| Looks up a value (if supported by your version) |
Round |
| Rounds to 2 decimal places |
Absolute value |
| Removes the sign |
Power |
| Squares the value |
Square root |
| Calculates the square root |
Today's date |
| Current date |
Current date & time |
| Current date and time |
Extract year |
| Returns the year |
Extract month |
| Returns the month |
Extract day |
| Returns the day |
Text length |
| Counts characters |
Join text |
| Combines text |
Left characters |
| First 3 characters |
Right characters |
| Last 3 characters |
Middle characters |
| 4 characters starting at position 2 |
Find text |
| Finds the position of "abc" |
Remove spaces |
| Removes extra spaces |
Lowercase |
| Converts to lowercase |
Uppercase |
| Converts to uppercase |
Proper case |
| Capitalizes each word |
Sum with condition |
| Sums B where A > 10 |
Count with condition |
| Counts values greater than 10 |
Average with condition |
| Averages matching values |
Error handling |
| Returns 0 instead of an error |
วัตถุประสงค์ | สูตร | ตัวอย่าง |
|---|---|---|
ผลรวม |
| รวมค่าทั้งหมดในช่วง A1–A10 |
ค่าเฉลี่ย |
| คำนวณค่าเฉลี่ย |
นับจำนวนตัวเลข |
| นับจำนวนเซลล์ที่มีตัวเลข |
นับเซลล์ที่ไม่ว่าง |
| นับจำนวนเซลล์ที่มีข้อมูล |
ค่าสูงสุด |
| คืนค่าที่มากที่สุด |
ค่าต่ำสุด |
| คืนค่าที่น้อยที่สุด |
เงื่อนไข IF |
| คืนค่า "Yes" หาก A1 > 10 มิฉะนั้นคืนค่า "No" |
ตรรกะ AND |
| คืนค่า TRUE เมื่อทั้งสองเงื่อนไขเป็นจริง |
ตรรกะ OR |
| คืนค่า TRUE เมื่อมีอย่างน้อยหนึ่งเงื่อนไขเป็นจริง |
ค้นหาข้อมูล |
| ค้นหา A1 ในคอลัมน์แรกและคืนค่าจากคอลัมน์ที่ 2 |
ค้นหาข้อมูลแบบใหม่ |
| ค้นหาค่าจากช่วงข้อมูล (หากเวอร์ชันรองรับ) |
ปัดเศษ |
| ปัดเศษให้เหลือ 2 ตำแหน่งทศนิยม |
ค่าสัมบูรณ์ |
| คืนค่าเป็นบวก (ตัดเครื่องหมายลบ) |
ยกกำลัง |
| ยกกำลังสองของค่า |
รากที่สอง |
| คำนวณรากที่สอง |
วันที่ปัจจุบัน |
| แสดงวันที่ปัจจุบัน |
วันที่และเวลาปัจจุบัน |
| แสดงวันที่และเวลาปัจจุบัน |
ดึงปี |
| คืนค่าปี |
ดึงเดือน |
| คืนค่าเดือน |
ดึงวัน |
| คืนค่าวัน |
ความยาวข้อความ |
| นับจำนวนตัวอักษร |
รวมข้อความ |
| รวมข้อความจากหลายเซลล์ |
ตัวอักษรด้านซ้าย |
| ดึง 3 ตัวอักษรแรก |
ตัวอักษรด้านขวา |
| ดึง 3 ตัวอักษรสุดท้าย |
ตัวอักษรตรงกลาง |
| ดึง 4 ตัวอักษร เริ่มจากตำแหน่งที่ 2 |
ค้นหาข้อความ |
| ค้นหาตำแหน่งของข้อความ "abc" |
ลบช่องว่าง |
| ลบช่องว่างส่วนเกิน |
แปลงเป็นตัวพิมพ์เล็ก |
| แปลงข้อความเป็นตัวพิมพ์เล็กทั้งหมด |
แปลงเป็นตัวพิมพ์ใหญ่ |
| แปลงข้อความเป็นตัวพิมพ์ใหญ่ทั้งหมด |
ตัวอักษรขึ้นต้นคำเป็นพิมพ์ใหญ่ |
| ทำให้ตัวอักษรแรกของแต่ละคำเป็นตัวพิมพ์ใหญ่ |
รวมค่าตามเงื่อนไข |
| รวมค่าจากคอลัมน์ B เมื่อ A > 10 |
นับค่าตามเงื่อนไข |
| นับจำนวนค่าที่มากกว่า 10 |
ค่าเฉลี่ยตามเงื่อนไข |
| หาค่าเฉลี่ยของค่าที่ตรงตามเงื่อนไข |
จัดการข้อผิดพลาด |
| คืนค่า 0 หากสูตรเกิดข้อผิดพลาด |