How do I test if a cell contains a formula or a number?

bellawala

Board Regular
Joined
Aug 20, 2002
Messages
73
Sorry for this simple question, but I can't find the answer. Basically, I'm just trying to see if a cell contains a formula from excel.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi,

this is the way I know of

select B1
menu Insert / Name / Define
namebox hasFormula
refers to =LEFT(GET.CELL(6,Sheet1!A1),1)="="

this formula in a cell
=hasFormula
will look at the cell to the left and return TRUE or FALSE

you can make it an absolute reference $A$1 (or $A1 or A$1)

kind regards,
Erik

EDIT: OK , learned something today from J WalkenBach :)
my formula would be simpler using
=GET.CELL(48,Sheet1!A1)
 
Upvote 0
I think it still doesn't quite work for me.

I should have been clearer in my original post. Let's say A1:A100 contain either dates or formulas that result in dates. In B1:B100 I would like to have TRUE or FALSE values specifying which of cells A1 - A100 are formulas. In truth, I do other actions based on whether or not there are forumlas in A1:A100, so the formatting solution doesn't work for me.

Is that clearer, or am I confused?

thanks for the help!
 
Upvote 0
Re: I think it still doesn't quite work for me.

I should have been clearer in my original post. Let's say A1:A100 contain either dates or formulas that result in dates. In B1:B100 I would like to have TRUE or FALSE values specifying which of cells A1 - A100 are formulas. In truth, I do other actions based on whether or not there are forumlas in A1:A100, so the formatting solution doesn't work for me.

Is that clearer, or am I confused?

thanks for the help!
you don't need to use it as conditional formatting
see also my post
 
Upvote 0
Doesn't ASAP or More Func have this function? Can't remember which and they're not on this machine so I can't check.

lenze
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,150
Members
448,552
Latest member
WORKINGWITHNOLEADER

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top