Checking For Numeric Before Computing?

  • Thread starter Thread starter PeteCresswell
  • Start date Start date
P

PeteCresswell

Seems like:

=IF(ISNUMBER(R8C15),IF(R8C15 > 0, R8C15/R1C17,Null),Null)

Should return Null if R8C15 contains "xxx".

But it returns "#NAME?" instead.

Can anybody see what I'm doing wrong?

(I'm pushing that "IF" statement into the cell's .FormulaR1C1 via VBA
code)
 
Seems like:

=IF(ISNUMBER(R8C15),IF(R8C15 > 0, R8C15/R1C17,Null),Null)

Should return Null if R8C15 contains "xxx".

But it returns "#NAME?" instead.

Can anybody see what I'm doing wrong?

(I'm pushing that "IF" statement into the cell's .FormulaR1C1 via VBA
code)

PS: It returns the expected ".1" if R1C17=10 and R8C15=1
 
Seems like:

=IF(ISNUMBER(R8C15),IF(R8C15 > 0, R8C15/R1C17,Null),Null)

Should return Null if R8C15 contains "xxx".

But it returns "#NAME?" instead.

Can anybody see what I'm doing wrong?

(I'm pushing that "IF" statement into the cell's .FormulaR1C1 via VBA
code)

Null is not a keyword. It needs to be in quotes.

=IF(ISNUMBER(R8C15),IF(R8C15 > 0, R8C15/R1C17,"Null"),"Null")


--ron
 
or maybe you wanted an empty string returned so the cell looked blank.

=IF(ISNUMBER(R8C15),IF(R8C15 > 0, R8C15/R1C17,""),"")

But don't expect that cell to be really empty--it has a formula in it.
 
Back
Top