Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
sony654
 
Posts: n/a
Default How do I correct the #DIV/0! error?

I am dividing number by "0", and want the result to be 100%, or -100%. For
example: -.06/0 should equal -100%. how do I address in the formula? Thanks.
--
Sony Luvy
  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

One way:

Assuming your divisor is in B1 and your dividend in A1:

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

Format the cell as a percentage.



In article ,
"sony654" wrote:

I am dividing number by "0", and want the result to be 100%, or -100%. For
example: -.06/0 should equal -100%. how do I address in the formula? Thanks.

  #3   Report Post  
sony654
 
Posts: n/a
Default

Here is the formula if it helps in responses, thanks again...
=IF(D29="N/A","0",IF(D29="Nil","0",IF(D29="Nil","0",IF(E29<0, (E29-D29)/E29,((E29-D29)/-E29)))))


"sony654" wrote:

I am dividing number by "0", and want the result to be 100%, or -100%. For
example: -.06/0 should equal -100%. how do I address in the formula? Thanks.
--
Sony Luvy

  #4   Report Post  
sony654
 
Posts: n/a
Default

Thanks JE, but this returned 0%, for example: (10-8)/8 = 25%,

(a2-b2)/b2 = 25%
if b2 would = 0, i want the result to be 100%
Tom

"JE McGimpsey" wrote:

One way:

Assuming your divisor is in B1 and your dividend in A1:

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

Format the cell as a percentage.



In article ,
"sony654" wrote:

I am dividing number by "0", and want the result to be 100%, or -100%. For
example: -.06/0 should equal -100%. how do I address in the formula? Thanks.


  #5   Report Post  
JE McGimpsey
 
Posts: n/a
Default

Did you really try it?

With the formula I gave you (adapted for using (A2-B2) rather than just
A2, which you didn't include in your original post):

=IF(B2=0,SIGN(A2),(A2-B2)/B2)

*does* return 100% when B2=0, not 0%.

The only way the formula can return 0% is if A2=B2.


In article ,
"sony654" wrote:

Thanks JE, but this returned 0%, for example: (10-8)/8 = 25%,

(a2-b2)/b2 = 25%
if b2 would = 0, i want the result to be 100%



  #6   Report Post  
Aladin Akyurek
 
Posts: n/a
Default

sony654 wrote:
Here is the formula if it helps in responses, thanks again...
=IF(D29="N/A","0",IF(D29="Nil","0",IF(D29="Nil","0",IF(E29<0, (E29-D29)/E29,((E29-D29)/-E29)))))


"sony654" wrote:


I am dividing number by "0", and want the result to be 100%, or -100%. For
example: -.06/0 should equal -100%. how do I address in the formula? Thanks.
--
Sony Luvy


When D29 is e.g., 2 and E29 0, your formula returns #DIV/0!.
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
How do I correct a cyclic redundancy check error Jeff Excel Discussion (Misc queries) 1 March 25th 05 06:09 PM
How do I correct a cyclic redundancy check error Ramakrishnan Rajamani Excel Discussion (Misc queries) 0 March 25th 05 06:01 PM
"Average" with error DIV/0 agenda9533 Excel Discussion (Misc queries) 1 March 2nd 05 05:47 PM
Simple #DIV/0! error AMY Z. Excel Worksheet Functions 2 January 23rd 05 10:25 PM
#DIV/0 Error Dominique Feteau Excel Worksheet Functions 2 December 19th 04 08:06 AM


All times are GMT +1. The time now is 10:26 PM.

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"