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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Question 1

Status
Not open for further replies.

shannanl

IS-IT--Management
Apr 24, 2003
1,071
US
I have a formula that subtracts the value of one cell (A1) from another cell (B1). I want to check for a valid number in each cell before attempting the formula. If either does not have a valid number then I want a zero in the cell.

Something like this:

= if isnumber(A1) and isnumber(B1) then SUM(B1-A1) else 0

Of course this forumla does not work. What is the correct syntax for this?

Thanks in advance.
 
=IF(AND(ISNUMBER(A1),ISNUMBER(B1)),B1-A1,0)

[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
Excellent, thank you very much.

Shannan
 
My pleasure

[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top