ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to use ERROR.TYPE in an IF function? (https://www.excelbanter.com/excel-worksheet-functions/241531-how-use-error-type-if-function.html)

ramudo

How to use ERROR.TYPE in an IF function?
 
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.

Dave Peterson

How to use ERROR.TYPE in an IF function?
 
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)



ramudo wrote:

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.


--

Dave Peterson

Pete_UK

How to use ERROR.TYPE in an IF function?
 
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

On Sep 3, 12:28*am, ramudo wrote:
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.



ramudo

How to use ERROR.TYPE in an IF function?
 
Thank you for your suggestion Dave Peterson.

"Dave Peterson" wrote:

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)



ramudo wrote:

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.


--

Dave Peterson



All times are GMT +1. The time now is 12:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com