Formula Problem


Posted by Dee on January 24, 2002 12:09 PM

I have a list w/3 columns. The first is Hours Est the second is hours actual and the last is Balance (Has positive and negative amounts). Anyway, my formula is =C7-D7. Which returns the value 0.00 if there isn't anything in C7 or D7. I can't get this to return a blank cell if there isn't anything in C or D7. Please help

Posted by DJ on January 24, 2002 12:19 PM

Try this:

=IF(C7-D7=0,"")

Posted by Mark O'Brien on January 24, 2002 12:26 PM

This is my first actual Excel formula post and I see somone else has already replied, but I worked it out and I'm posting my version anyway. I usually just post VBA problems.

=IF(AND(C7="", D7=""), "", C7-D7)

DJ's formula will return a blank if both times are the same.

Posted by Dee on January 24, 2002 12:26 PM

I think I got it figured out. I used this formula. Is there a better way? Thanks a lot!
IF(SUM(C6-D6)=0,"",SUM(C6-D6))

Posted by Mike Golding on January 24, 2002 5:37 PM




Posted by Mike Golding on January 24, 2002 5:43 PM

Whoops I've lost the start of my first reply somewhere.

I want to say that I am impressed with the answer that uses the AND in the Formula. I have been using the other answer for some years now and I missed out on the AND. Good One.