Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default 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.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
Type Mismatch Error Minitman Excel Discussion (Misc queries) 7 June 21st 08 02:15 AM
xpath error? Runtime Error 13 type mismatch Steve M[_2_] Excel Discussion (Misc queries) 0 January 17th 08 01:16 AM
xpath error? Runtime Error 13 type mismatch SteveM Excel Discussion (Misc queries) 1 December 4th 07 09:16 AM
Why type mismatch - R/T error 13 Jim May Excel Discussion (Misc queries) 5 January 9th 05 06:45 PM


All times are GMT +1. The time now is 03:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"