Help - cannot compare values properly even though they display same thing!

T

Tommy

I have a simple IF statement that compares the values of two cells:
=IF(D5=G5,"Good","Bad"). Simple enough. The problem is that even when
the value of the cell is exactly the same i.e both D5 and G5 show
"WT_STEDY", it is still returning "Bad". I did a little bit of error
checking: trimmed both cells to ensure no rogue spaces were there etc.
The difference lies in the formula bar. For cell G5, the bar
shows:"WT_STEDY" whereas for cell D5 it shows "=PISampDat($D$1,$B$5,$B
$748,"1h", 0)" which is call from a database. How do I change my
original IF statement to compare the actual strings output / displayed
in the two cells?? I don't mind using some VB, but I'd rather not
because the problem seems so trivial.

Regards,

Tom
 
B

Bob Umlas

You shouldn't need to do anything special -- Excel's IF statement DOES
compare the value, not the formula. Click in the formulabar for D5 & press
F9 -- does it still say WT_STEDY? Do you have calculation set to automatic?
Bob Umlas
Excel MVP
 
G

Guest

Select the cell with the =PISampDat($D$1,$B$5,$B$748,"1h", 0) formula
Press the F2 key, then the F9 key. Does the result EXACTLY match your
WT_STEDY string, or is there a leading/trailing space(s)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top