Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
=IF(F46=0,I45-C46,I45-F46)

This works. But now I want to include the following as well: Let's say F46 is text – I want the cell value to be I45 (the previous cell value) but if it's not text I want it to be I45-F46.

share|improve this question

2 Answers 2

in cases like these, use IS functions:

=IF(F46=0,I45-C46,IF(ISTEXT(I46),I45,I45-F46))
share|improve this answer

You could also try this formula

=IF(F46=0,I45-C46,I45-N(F46))

N just returns the numeric value of any cell.

If the cell contains a text value it returns zero; so, if A1 = 4 then =N(A1)=4, if A1 = "x" then =N(A1)=0.

share|improve this answer
    
What does N( ) do? –  Tom Wijsman Jun 5 '12 at 12:46
    
Hello Tom - N just returns the numeric value of any cell - if the cell contains a text value it returns zero, so if A1 = 4 then =N(A1)=4, if A1 = "x" then =N(A1)=0 –  barry houdini Jun 5 '12 at 13:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.