Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXCEL: formula result not coming up as expected???

Status
Not open for further replies.

cutestuff

Technical User
Joined
Sep 7, 2006
Messages
162
Location
CA
hi,
I'm sure this is real simple but I can't figure out why.
I am just trying to do a simple IF statement in Excel.
Basically, the scenario is:
If cell H3 = 0 then put a blank in cell J3.
Sounds simple huh?
Well, I've put this formula on J3: IF(H3=0,"", H3-I3)
But it keeps coming up with: 0
However, if I put: IF(H3>0,"", H3-I3) and the value of H3 is 0, it comes up with blank.
Why is that? How could 0 > 0????
Cells H3 and I3 get their values from a lookup formula. All it returns is a number (0, 1, 2, etc.)

Please, any help is appreciated. I'm sure it's something I overlooked?

Thanks,
cs
 


Hi,

Do you have a literal value in H3 or a FORMULA?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
hi Skip!
H3, I3 and J3 all have formulas.
H3 and I3 are Vlookup formulas that return a number.
J3 just has the formula: =H3-I3
I think looking at it closely it seems as though it's not reading it as 0 because of the formula? Is there a way around this? I tried conditional formatting too but same issue. :(
 
Oh. I think I kind of solved the problem. I just manipulated the formula. It worked for what I needed for now. I still don't know why the above didn't work but oh well.
 


I just manipulated the formula.
HOW? Please post your solution.

Some formulas can return, what seems to be, unexpected results.


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
I just changed the formula to:
IF(H3+I3=0, "", H3-I3)
It seems as though if I just put H3=0 it doesn't read the result correctly. But if I put some type of calculation in the first part it works. Like I said, it worked for my particular situation but it's still not my ideal solution. :)
 


How about when H3 is ZERO and I3 is not?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
The reason I said this formula will just work in this particular instance is when H3 is ZERO, I3 will ALWAYS be zero. That's why I was just putting H3=0 in the beginning - putting I3 =0 also will be redundant.
 


That tells me, I believe, that you have formulas in your source data in "empty" rows, in anticipation of data being entered at some later time.

YES?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Not sure what you meant there...
 



WHY will either H3 or I3 exclusively never have a ZERO?

You may very well have a valid reason why both can be zero but neither can be zero exclusively.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Ok...maybe this will help:
I3 holds the value for completed pieces for a particular item.
H3 is the TOTAL number of pieces (completed or not).
Which is why if the TOTAL is zero (H3=0), I can assume that I3 will be zero (no items = nothing complete).
Does that make sense?
 


OK.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top