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
 
Thanks Frank! This was my problem. It works fine now. Thanks for the help!

Steven
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Excel Subtracting multiple columns from another column 3
Auto-adjusting Formulas 1
Moving Formulas when Sorting 2
Excel VBA 1
Countif formula 2
Formula To Return True 5
Formula 1
formula vs constant 1

Back
Top