ISERR


Tests for an error value other than #N/A.

Syntax:

ISERR(value)

Returns TRUE if value refers to or evaluates to an error value other than the Not Available error #N/A, and FALSE otherwise.

Use the ISERROR function to test for any errors including #N/A.

Example:

ISERR(SQRT(-1))

returns TRUE, because taking the squareroot of -1 is an error.

ISERR(C5)

where C5 contains 123, returns FALSE, because 123 is not an error.

ISERR(NA())

returns FALSE, because the error value #N/A is ignored by this function.


Application:

Imagine you are a teacher and you have a grade book for your students. You want to calculate their average score, but some cells might have errors for various reasons.


  • A student might have been absent, so you entered "ABS" instead of a score, causing a #VALUE! error when calculating.
  • A student might not have a score for a particular assignment, so you entered "NA" (for Not Applicable), which might result in a #REF! error or similar depending on your setup.
  • You might have a blank cell where a score should be, which could also cause a different error.
  • You might also have #N/A errors if you're using a lookup function like VLOOKUP to pull scores from another sheet, and it can't find the student's name.


You want to calculate the average score for each student, but you want to exclude any scores that are causing an error. However, you want to specifically handle the #N/A error differently, perhaps by just ignoring it, but treating other errors as a zero score for the purpose of the average.


The ISERR Function in Action


Let's look at the data in a table:

Student Name

Quiz 1

Quiz 2

Quiz 3

Average Score

A
B
C
D
E
1
Alex
85
92
88
88.333333333
2
Ben
78
80
#VALUE!
79
3
Carla
90
95
#N/A
92.5
4
David
65
#DIV/0!
70
67.5

Here's how you would use the ISERR function to calculate the "Average Score" column.


For each student's row, you'd use an IF statement in combination with ISERR. The logic would be: "If the cell has an error (excluding #N/A), treat it as a 0; otherwise, use the actual value."


The formula for Ben's average score (in the "Average Score" cell for Ben) would look something like this:

AVERAGE(IF(ISERR(B2), 0, B2), IF(ISERR(C2), 0, C2), IF(ISERR(D2), 0, D2))


  • ISERR(B2): Checks if the score in Quiz 1 for Ben (78) is an error. It's not, so ISERR returns FALSE. The IF statement then uses the value 78.
  • ISERR(C2): Checks if the score in Quiz 2 for Ben (80) is an error. It's not, so ISERR returns FALSE. The IF statement then uses the value 80.
  • ISERR(D2): Checks if the score in Quiz 3 for Ben (#VALUE!) is an error. It is, and it's not #N/A, so ISERR returns TRUE. The IF statement then uses the value 0.


The AVERAGE function then calculates the average of (78, 80, 0), which is 52.67. This isn't the desired outcome. The better approach is to use ISERR to handle the error values and simply ignore the #N/A values.


A more effective formula to get the result shown in the table:

IFERROR(AVERAGE(B2:D2), IFERROR(AVERAGE(IF(ISERR(B2), "", B3), IF(ISERR(C2), "", C2), IF(ISERR(D2), "", D2)), ""))


This formula is a bit complex, but it shows the power of the functions. A simpler, more direct application of ISERR would be to use a different column to clean the data first.


Step-by-Step with a "Cleaned Score" Column:

Let's add three new columns to the table to show the logic more clearly.

Student Name

Quiz 1

Quiz 2

Quiz 3

Average Score

Cleaned Quiz 1

Cleaned Quiz 2

Cleaned Quiz 3

Cleaned Average Score

A
B
C
D
E
F
G
H
I
1
Alex
85
92
88
88.333333333
85
92
88
88.333333333
2
Ben
78
80
#VALUE!
79
78
80
0
52.666666667
3
Carla
90
95
#N/A
92.5
90
95
#N/A
92.5
4
David
65
#DIV/0!
70
67.5
65
0
70
45

Formula for "Cleaned Quiz 1" (and so on):

IF(ISERR(B1), 0, B1)

  • For Ben's Quiz 3 (#VALUE!), ISERR(D2) is TRUE, so the formula returns 0.
  • For Carla's Quiz 3 (#N/A), ISERR(D3) is FALSE (since it ignores #N/A), so the formula returns #N/A.


Formula for "Average Score" column:

AVERAGE(F1:H1)


This formula will now correctly calculate the average for each student, with #N/A values being automatically ignored by the AVERAGE function and other errors being converted to 0. This is the most practical and clear way to use ISERR.





This page is protected by Google reCAPTCHA. Privacy - Terms.
 
Built using Zapof