Neg. Number

aapjrat5128

Board Regular
Joined
Apr 7, 2002
Messages
53
I have the following formula in E58
=IF(ISERROR(C58/D58),””,C58/D58)
My problem is that there is a number in
D58 but not in C58 and I get a negative number,
Is there any way that I can change the formula?
So that I can get a zero or blank.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
why don't you change the formula in C so that it reads if there is anything in column b before it computes to the negative?
 
Upvote 0
your difficulties stem from an inappropriate use of the iserror checks. You are attempting, I assume, only to calculate when it's appropriate - i.e. when the cells concerned have data in them. iserror is not going to do that for you - it's going to check for errors (no surprises there!). blank cells / zro values are not errors. One method to check for whether a cell has a value is with a len() check - it there's nothing in a cell, len() retuns zero. as zero is also understood as false by excel, this method can be used in if() statements.

consider changing your formulas from things of the form:

=IF(ISERROR(B54-B52),"",B54-B52)

to one like:

=IF(len(b52),B54-B52,"")

and see what you get.

paddy
 
Upvote 0

Forum statistics

Threads
1,214,874
Messages
6,122,034
Members
449,061
Latest member
TheRealJoaquin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top