=ISFORMULA(A1) ?

eliW

Well-known Member
Joined
Mar 2, 2002
Messages
1,940
Is there in Excel any function to check if a cell contains a formula, like for example =ISNUMBER(A1) or ISTEXT(A1)?
Eli
This message was edited by eliW on 2002-04-08 14:35
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
On 2002-04-08 14:29, eliW wrote:
Is there in Excel any function to check if a cell contains a formula, like for example =ISNUMBER(A1) or ISTEXT(A1)?
Eli

No. It's not too difficult though to set up a UDF. I might add that such a built-in function would be a totally different beast among the IS-functions which all directed at values in a cell, not at the underlying generator of values.

Aladin
 
Upvote 0
Hi,

Could not get the Excel TYPE(Value) function to test True for 8 (the formula), but here is an UDF that works.

-----------------------
Function IsFormula(RefCell As Range)
If RefCell.Cells.Count <> 1 Then
IsFormula = CVErr(xlErrValue)
Else
IsFormula = RefCell.HasFormula
End If
End Function
-----------------------

Returns True or False. Called as
=ISFORMULA(A1)

Should work with other functions.

HTH,
Jay
 
Upvote 0
On 2002-04-08 14:29, eliW wrote:
Is there in Excel any function to check if a cell contains a formula, like for example =ISNUMBER(A1) or ISTEXT(A1)?
Eli
This message was edited by eliW on 2002-04-08 14:35

You could cheat!!

1. Enter =A2+2 into cell A1.
2. With cell B1 selected setup a defined name, Has_Formula, that refers to...

=GET.CELL(48,A1)

Now, you can enter the formula, =Has_Formula, in any cell to see if the cell to its left contains a formula. =Has_Formula will return TRUE or FALSE.
This message was edited by Mark W. on 2002-04-08 16:19
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,387
Members
448,957
Latest member
Hat4Life

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