Identifying formulas with a formula

  • Thread starter Thread starter Steven
  • Start date Start date
S

Steven

I need a formula to check a cell to see if it has a formula in it.

Example:

c: = a*b
d: = c\45

However, i need c: to = a*b if d: has a formula and c: to = d*45 if d:
is a number I enter.

I have been unable to figure out how to write a formula that will
determine if another cell has a formula or not.

Any help will be appreciated.

Thanks, Steven
 
Hi Steven
you may try the following UDF (put in a module of your workbook)

Function is_formula(rng As Range)
is_formula = rng.HasFormula
End Function

Now enter the following in C1
=IF(is_formula(D1),D1*45,A1*B1)
 
Thanks for the reply Frank! I have tried this and several variations
I found. When I try using the function in a cell I get the #NAME
error.

What am I doing wrong?

Thanks, Steven
 
Back
Top