How to use ERROR.TYPE in an IF function?

  • Thread starter Thread starter ramudo
  • Start date Start date
R

ramudo

I am getting error message #DIV/0! - How can I use ERROR.TYPE in an IF
function to bypass this error so that I can sum a column? OR, is there a
better way to achieve the same result? Thank you.
 
I ususually weasel out and just check for an error:

=if(iserror(a1/b1),"",a1/b1)
or just check the denominator:
=if(b1=0,"",a1/b1)

But you could use a different formula to sum the column:

instead of:
=sum(a:a)

you can use:
=sumif(a:a,"<1e37")

1E37 is just a giant number (1 followed by 37 0's)
 
You should trap the error at source. That particular error comes from
trying to divide by zero, so if you have a formula like:

=A1/B1

and B1 can be zero or blank, then you can trap it using a formula like
this:

=IF(B1=0,"",A1/B1)

This will return a blank, but you could use 0 instead of "" in the
formula if you prefer.

SUM will ignore blanks.

Hope this helps.

Pete
 
Thank you for your suggestion Dave Peterson.

Dave Peterson said:
I ususually weasel out and just check for an error:

=if(iserror(a1/b1),"",a1/b1)
or just check the denominator:
=if(b1=0,"",a1/b1)

But you could use a different formula to sum the column:

instead of:
=sum(a:a)

you can use:
=sumif(a:a,"<1e37")

1E37 is just a giant number (1 followed by 37 0's)
 
Back
Top