PDA

View Full Version : Solved: Nested IF function



U_Shrestha
04-06-2010, 06:50 AM
Hi,

In the attached table, I need to compare two corresponding data and need to determine if the data increased, decreased or remained the same. I used "If" function like this:

IF(B2>A2,"Increased",IF(B2<A2,"Decreased",IF(B2=A2,"No change","Check!")))
The problem with my data is that some of the data has text instead of number which is "ND". What I am looking for is, can the IF function somehow consider ND as "0" and then perform the calculation because I got a error with my current function when there was "ND" in one of the cell (please see C11, the data should have been "Decreased").

Can someone help? Thanks.

Bob Phillips
04-06-2010, 07:03 AM
tRY

=IF(N(B2)>N(A2),"Increased",IF(N(B2)<N(A2),"Decreased","No change"))

U_Shrestha
04-06-2010, 07:08 AM
Hi xld,

That worked, thank you very much sir.

Question, how did "n" in the formula changed the function?

Bob Phillips
04-06-2010, 07:31 AM
It takes the numeric value, which is zero for text.

U_Shrestha
04-06-2010, 07:39 AM
Great! Thanks :)