Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
=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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .