I'm trying to obtain a formula that will accomplish two things:
1. Leave the cell blank if there is a computing error; and
2. Leave the cell blank if the computation results in the negative of another cell.
For the first condition, I came up with:
=IF(OR(ISERROR(A1-A2), ISERROR(A2-A1))," ",A1-A2)
This formula subtracts A2 from A1, and leaves the cell blank if an error would result from subtracting A2 from A1, or vice-versa.
For the second condition, I came up with:
=IF(OR(A1-A2=-A2, A2-A1=-A1)," ",A1-A2)
This formula subtracts A2 from A1, and leaves the cell blank if a value is missing for either A1 or A2.
Sometimes in my spreadsheet, I get the formula error. Other times, I get the negative of the other cell. I'm not sure why this happens; that's why I'd like to solve for both conditions in one formula.
I've tried many, many times to write a single formula that combines both conditions, with no luck. Any suggestions?
2006-12-15
06:05:46
·
3 answers
·
asked by
Anonymous