ID EN
#Logical

IFERROR

Excel Functions 🇮🇩 Bahasa Indonesia

Menjebak dan menangani kesalahan

Syntax

EXCEL
=IFERROR(value, value_if_error)

Arguments

Parameter Deskripsi
value The value, reference, or formula to check for an error.
value_if_error The value to return if an error is found.

Return Value

Nilai yang Anda tentukan untuk kondisi kesalahan.

Details

Fungsi IFERROR mengembalikan hasil khusus ketika rumus mengembalikan kesalahan dan hasil normal ketika rumus menghitung tanpa kesalahan. Sintaks umum untuk fungsi IFERROR terlihat seperti ini: Pada contoh di atas, "rumus" mewakili rumus yang mungkin menghasilkan kesalahan, dan "custom" mewakili nilai yang harus dikembalikan jika rumus menghasilkan kesalahan. Hal ini menjadikan IFERROR cara yang elegan untuk menjebak dan mengelola kesalahan dalam satu langkah. Sebelum IFERROR diperkenalkan, pernyataan IF bertingkat yang lebih rumit perlu digunakan bersama dengan fungsi ISERROR yang lama. Anda dapat menggunakan fungsi IFERROR untuk menjebak dan menangani kesalahan yang dihasilkan oleh rumus atau fungsi lain. IFERROR memeriksa kesalahan berikut: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, atau #NULL!. Dalam contoh

Contoh

Example 1

The IFERROR function returns a custom result when a formula returns an error and a normal result when a formula calculates without an error. The typic

EXCEL
=IFERROR(formula,custom)
Example 1 - Trap #DIV/0! errors

In the example shown, the formula in E5 copied down is:

EXCEL
=IFERROR(C5/D5,0)
Example 1 - Trap #DIV/0! errors

This formula catches the #DIV/0! error that occurs when the quantity field is empty or zero, and replaces it with zero. You are free to change the zer

EXCEL
=IFERROR(C5/D5,"")
Example 2 - request input before calculating

Sometimes you may want to suppress a calculation until the worksheet receives specific input. For example, if A1 contains 10, B1 is blank, and C1 cont

EXCEL
=IFERROR(A1/B1) // returns #DIV! if B1 is empty
Example 2 - request input before calculating

The formula below has been modified to use the IFERROR function to trap the #DIV/0! error and remap it to the message "Please enter a value in B1".

EXCEL
=IFERROR(A1/B1,"Please enter a value in B1")
Example 3 - Sum and ignore errors

A common problem in Excel is that errors in data will corrupt the results of other formulas. For example, in the worksheet shown below, the goal is to

EXCEL
=SUM(D5:D15) // returns #N/A

See Also

ISERROR IFNA