Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default How do I include the formula to return 0 when divided by zero?

I'm need to include the IF 0,0 formula in the formula below.
In this formula, C29 = Sales Goal, D29 = Sales Achieved, and E29 returns the
results. The formula is set up to account for times when there is a zero
goal, but a sale $ amount which means the sales rep gets 100% in E29 or, if
there is both a goal and sales acount they get the percentage of sales to
goal. However, when there is neither a goal or sales, the E29 result can't
return a #DIV/0! or the total cell that E29 rolls up into won't function
correctly. Help!

=IF(AND(C29=0,D290),100%,D29/C29)
--
News Gal
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 97
Default How do I include the formula to return 0 when divided by zero?

Try:
=IF(ISERROR(IF(AND(C29=0,D290),100%,D29/C29)),"",IF(AND(C29=0,D290),100%,D29/C29))

Or, if you want to show a zero, change the "" to 0
Regards,

"Newsgal" wrote:

I'm need to include the IF 0,0 formula in the formula below.
In this formula, C29 = Sales Goal, D29 = Sales Achieved, and E29 returns the
results. The formula is set up to account for times when there is a zero
goal, but a sale $ amount which means the sales rep gets 100% in E29 or, if
there is both a goal and sales acount they get the percentage of sales to
goal. However, when there is neither a goal or sales, the E29 result can't
return a #DIV/0! or the total cell that E29 rolls up into won't function
correctly. Help!

=IF(AND(C29=0,D290),100%,D29/C29)
--
News Gal

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default How do I include the formula to return 0 when divided by zero?

ISERROR will trap all errors. If you specifically want to trap when C29
is zero in order to avoid the #DIV/0 error, then try this:

=IF(AND(C29=0,D290),100%,IF(C29=0,0,D29/C29))

This returns zero instead of #DIV/0 - change the middle of the second
IF to ,"", instead of ,0, if you want a blank.

Hope this helps.

Pete

Myriam wrote:

Try:
=IF(ISERROR(IF(AND(C29=0,D290),100%,D29/C29)),"",IF(AND(C29=0,D290),100%,D29/C29))

Or, if you want to show a zero, change the "" to 0
Regards,

"Newsgal" wrote:

I'm need to include the IF 0,0 formula in the formula below.
In this formula, C29 = Sales Goal, D29 = Sales Achieved, and E29 returns the
results. The formula is set up to account for times when there is a zero
goal, but a sale $ amount which means the sales rep gets 100% in E29 or, if
there is both a goal and sales acount they get the percentage of sales to
goal. However, when there is neither a goal or sales, the E29 result can't
return a #DIV/0! or the total cell that E29 rolls up into won't function
correctly. Help!

=IF(AND(C29=0,D290),100%,D29/C29)
--
News Gal


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default How do I include the formula to return 0 when divided by zero?

Worked perfectly! Thanks!
--
News Gal


"Pete_UK" wrote:

ISERROR will trap all errors. If you specifically want to trap when C29
is zero in order to avoid the #DIV/0 error, then try this:

=IF(AND(C29=0,D290),100%,IF(C29=0,0,D29/C29))

This returns zero instead of #DIV/0 - change the middle of the second
IF to ,"", instead of ,0, if you want a blank.

Hope this helps.

Pete

Myriam wrote:

Try:
=IF(ISERROR(IF(AND(C29=0,D290),100%,D29/C29)),"",IF(AND(C29=0,D290),100%,D29/C29))

Or, if you want to show a zero, change the "" to 0
Regards,

"Newsgal" wrote:

I'm need to include the IF 0,0 formula in the formula below.
In this formula, C29 = Sales Goal, D29 = Sales Achieved, and E29 returns the
results. The formula is set up to account for times when there is a zero
goal, but a sale $ amount which means the sales rep gets 100% in E29 or, if
there is both a goal and sales acount they get the percentage of sales to
goal. However, when there is neither a goal or sales, the E29 result can't
return a #DIV/0! or the total cell that E29 rolls up into won't function
correctly. Help!

=IF(AND(C29=0,D290),100%,D29/C29)
--
News Gal



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default How do I include the formula to return 0 when divided by zero?

Thanks for the feedback.

Pete

Newsgal wrote:

Worked perfectly! Thanks!
--
News Gal


"Pete_UK" wrote:

ISERROR will trap all errors. If you specifically want to trap when C29
is zero in order to avoid the #DIV/0 error, then try this:

=IF(AND(C29=0,D290),100%,IF(C29=0,0,D29/C29))

This returns zero instead of #DIV/0 - change the middle of the second
IF to ,"", instead of ,0, if you want a blank.

Hope this helps.

Pete

Myriam wrote:

Try:
=IF(ISERROR(IF(AND(C29=0,D290),100%,D29/C29)),"",IF(AND(C29=0,D290),100%,D29/C29))

Or, if you want to show a zero, change the "" to 0
Regards,

"Newsgal" wrote:

I'm need to include the IF 0,0 formula in the formula below.
In this formula, C29 = Sales Goal, D29 = Sales Achieved, and E29 returns the
results. The formula is set up to account for times when there is a zero
goal, but a sale $ amount which means the sales rep gets 100% in E29 or, if
there is both a goal and sales acount they get the percentage of sales to
goal. However, when there is neither a goal or sales, the E29 result can't
return a #DIV/0! or the total cell that E29 rolls up into won't function
correctly. Help!

=IF(AND(C29=0,D290),100%,D29/C29)
--
News Gal




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
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 07:48 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 AM
Formula to return cell contents based on multiple conditions Bill Excel Worksheet Functions 3 January 19th 05 09:59 AM


All times are GMT +1. The time now is 12:08 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"