IFERROR Function
Returns a custom value when a formula produces an error, and the formula's result when it succeeds. Essential for handling #N/A, #DIV/0!, #VALUE!, and other errors gracefully.
ExcelGoogle Sheets
Syntaxe
IFERROR(value, value_if_error)Paramètres
| Paramètre | Description |
|---|---|
| value | The formula or expression to evaluate. |
| value_if_error | The value to return if the formula produces an error. |
Exemples
Handle VLOOKUP not-found errors
=IFERROR(VLOOKUP(A1, D:E, 2, FALSE), "Not found")Résultat: Not found (if A1 value doesn't exist in column D)
Avoid division by zero errors
=IFERROR(A1/B1, 0)Résultat: 0 (if B1 is 0 or empty)
Default value for missing data
=IFERROR(INDEX(B:B, MATCH(A1, C:C, 0)), "N/A")Résultat: N/A (if no match found)
Conseils et bonnes pratiques
- •IFERROR catches ALL error types. Use IFNA if you only want to catch #N/A.
- •Don't use IFERROR to mask unexpected errors — it can hide bugs in your formulas.
- •XLOOKUP has a built-in if_not_found parameter, reducing the need for IFERROR.
- •In Google Sheets, IFERROR with no second argument returns an empty string.
Formules associées
Besoin d'une autre formule ?
Décrivez ce dont vous avez besoin en texte simple et notre IA générera la formule pour vous.
Essayer le Générateur de formules