Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
James Hamilton
 
Posts: n/a
Default #DIV/0! and IF statement

I have 3 columns of data; A, B and C.

The formula for column C is = (A-B)/B

If column A is 0, then the result is -100%

If both column A and column B is 0 the result is #DIV/0!

What formula do I use so that when the answer is -100%, it says this, but
when the answer is #DIV/0!, I get a blank?

I'm trying is =if(iserror((a-b)/b),"",(a-b/b)) but I get blanks even if the
answer is -100%.

Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.misc
Toppers
 
Posts: n/a
Default #DIV/0! and IF statement

James,

=IF(B1=0," ",(A1-B1)/B1)

"James Hamilton" wrote:

I have 3 columns of data; A, B and C.

The formula for column C is = (A-B)/B

If column A is 0, then the result is -100%

If both column A and column B is 0 the result is #DIV/0!

What formula do I use so that when the answer is -100%, it says this, but
when the answer is #DIV/0!, I get a blank?

I'm trying is =if(iserror((a-b)/b),"",(a-b/b)) but I get blanks even if the
answer is -100%.

Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.misc
Justloseit
 
Posts: n/a
Default #DIV/0! and IF statement

Go to tools and click conditional formatting. Click on the drop down
list and select "Formula is" then type this in the text box next to it
=ISERROR(C3)

Then click format button and click the color drop down box and select
white. (Even if the orginal color of the color drop down box is white
still click on it and select white or it will not work)

  #4   Report Post  
Posted to microsoft.public.excel.misc
James Hamilton
 
Posts: n/a
Default #DIV/0! and IF statement

Excellent. Many thanks.

I actually worked it out the same as below.

Cheers.

"Justloseit" wrote:

Go to tools and click conditional formatting. Click on the drop down
list and select "Formula is" then type this in the text box next to it
=ISERROR(C3)

Then click format button and click the color drop down box and select
white. (Even if the orginal color of the color drop down box is white
still click on it and select white or it will not work)


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 you write an if statement that replaces #DIV/0! with 0 caliskier Excel Discussion (Misc queries) 6 March 10th 06 03:22 AM
How to hide #DIV/0! in cells waiting for input? Pheasant Plucker® Excel Discussion (Misc queries) 4 January 26th 06 04:30 PM
SET statement tutorial Daminc Excel Discussion (Misc queries) 13 January 17th 06 04:47 PM
If statement Matt Montagliano Excel Discussion (Misc queries) 1 September 8th 05 08:47 PM
Do I need a sumif or sum of a vlookup formula? PeterB Excel Worksheet Functions 0 June 1st 05 12:23 PM


All times are GMT +1. The time now is 06:54 AM.

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

About Us

"It's about Microsoft Excel"