Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Titanium
 
Posts: n/a
Default excel divide by zero error

I'm trying to write a formula to calculate the percentage of two cells. The
simplified formula reads:
=B12/(B12 + H12)

The problem is when H12 and B12 both = zero. Zero divided by zero = divide
by zero error.

The desired result, display 0%

I looked at the online help, and it gives me a sample formula, but for the
life of me, i just can't seem to get it to work out with 'my desired
result'...

help... please... :)
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student
 
Posts: n/a
Default excel divide by zero error

=if(B12=0,0,B12/(B12+H12))
--
Gary's Student


"Titanium" wrote:

I'm trying to write a formula to calculate the percentage of two cells. The
simplified formula reads:
=B12/(B12 + H12)

The problem is when H12 and B12 both = zero. Zero divided by zero = divide
by zero error.

The desired result, display 0%

I looked at the online help, and it gives me a sample formula, but for the
life of me, i just can't seem to get it to work out with 'my desired
result'...

help... please... :)

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Titanium
 
Posts: n/a
Default excel divide by zero error

that's wonderful!! Thanks, it worked perfectly :)



"Gary''s Student" wrote:

=if(B12=0,0,B12/(B12+H12))
--
Gary's Student


"Titanium" wrote:

I'm trying to write a formula to calculate the percentage of two cells. The
simplified formula reads:
=B12/(B12 + H12)

The problem is when H12 and B12 both = zero. Zero divided by zero = divide
by zero error.

The desired result, display 0%

I looked at the online help, and it gives me a sample formula, but for the
life of me, i just can't seem to get it to work out with 'my desired
result'...

help... please... :)

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Titanium
 
Posts: n/a
Default excel divide by zero error

hate to bother you yet again, but I'm trying to make sure that I understand
the statement you wrote... can you please explain the syntax, I'm just trying
to make better sense of it than i'm doing on my own... :)

"Gary''s Student" wrote:

=if(B12=0,0,B12/(B12+H12))
--
Gary's Student


"Titanium" wrote:

I'm trying to write a formula to calculate the percentage of two cells. The
simplified formula reads:
=B12/(B12 + H12)

The problem is when H12 and B12 both = zero. Zero divided by zero = divide
by zero error.

The desired result, display 0%

I looked at the online help, and it gives me a sample formula, but for the
life of me, i just can't seem to get it to work out with 'my desired
result'...

help... please... :)

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student
 
Posts: n/a
Default excel divide by zero error

No problem:

What the IF does is to say that if B12 is zero, don't both to do the
division, just return zero. This approach works if B12 and H12 are both zero.

Another case that you didn't mention is something like B12=-1 and H12=+1 In
this case you would want something like:

=IF((B12+H12)=0,0,B12/(B12+H12))

I like this form better because it covers both cases.


--
Gary's Student


"Titanium" wrote:

hate to bother you yet again, but I'm trying to make sure that I understand
the statement you wrote... can you please explain the syntax, I'm just trying
to make better sense of it than i'm doing on my own... :)

"Gary''s Student" wrote:

=if(B12=0,0,))
--
Gary's Student


"Titanium" wrote:

I'm trying to write a formula to calculate the percentage of two cells. The
simplified formula reads:
=B12/(B12 + H12)

The problem is when H12 and B12 both = zero. Zero divided by zero = divide
by zero error.

The desired result, display 0%

I looked at the online help, and it gives me a sample formula, but for the
life of me, i just can't seem to get it to work out with 'my desired
result'...

help... please... :)



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Titanium
 
Posts: n/a
Default excel divide by zero error

That's what I thought, but... i didn't want to start making assumptions on
syntax. I find it better to be sure about something, because when you want to
put it to use, poor understanding of the syntax only leads to errors,
logically or otherwise... Although it's impossible to obtain a -1 in my
particular case, I like the second formula better as well. :) btw, tell Gary
he's a great teacher ;) Thanks for all your help! :)

"Gary''s Student" wrote:

No problem:

What the IF does is to say that if B12 is zero, don't both to do the
division, just return zero. This approach works if B12 and H12 are both zero.

Another case that you didn't mention is something like B12=-1 and H12=+1 In
this case you would want something like:

=IF((B12+H12)=0,0,B12/(B12+H12))

I like this form better because it covers both cases.


--
Gary's Student


"Titanium" wrote:

hate to bother you yet again, but I'm trying to make sure that I understand
the statement you wrote... can you please explain the syntax, I'm just trying
to make better sense of it than i'm doing on my own... :)

"Gary''s Student" wrote:

=if(B12=0,0,))
--
Gary's Student


"Titanium" wrote:

I'm trying to write a formula to calculate the percentage of two cells. The
simplified formula reads:
=B12/(B12 + H12)

The problem is when H12 and B12 both = zero. Zero divided by zero = divide
by zero error.

The desired result, display 0%

I looked at the online help, and it gives me a sample formula, but for the
life of me, i just can't seem to get it to work out with 'my desired
result'...

help... please... :)

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
Problem Opening an Excel File MSO9.DLL Error Mash23 Links and Linking in Excel 1 October 5th 05 06:20 AM
Excel Range Value issue (Excel 97 Vs Excel 2003) Keeno Excel Discussion (Misc queries) 2 June 13th 05 02:01 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
Run-time Error in Excel? Elena Excel Worksheet Functions 0 April 20th 05 04:26 PM
error opening excel file jp New Users to Excel 1 February 19th 05 01:22 AM


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