Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
can you use an IF function (or any function) to return a value if a certain
cell contains a formula as opposed to an inputted value. I would like to be able to see this indicator on a printout out of the spreadsheet. Thanks |
#2
![]() |
|||
|
|||
![]()
Create a UDF and use that in the IF test
Function IsFormula(rng As Range) IsFormula = rng.HasFormula End Function -- HTH RP (remove nothere from the email address if mailing direct) "chopsx7" wrote in message ... can you use an IF function (or any function) to return a value if a certain cell contains a formula as opposed to an inputted value. I would like to be able to see this indicator on a printout out of the spreadsheet. Thanks |
#3
![]() |
|||
|
|||
![]()
You can't do it directly with a worksheet formula, but a
simple UDF would work. Something like: Function IsFormula(Cell As Range) As String If Cell.HasFormula = True Then IsFormula = "Formula" Else IsFormula = "" End If End Function --- To use, press ALT+F11, go to Insert Module, and paste in the code. Press ALT+Q. Call the UDF in a cell as: =isformula(A1) Of course the formula will display "Formula" in cases like "=100". HTH Jason Atlanta, GA -----Original Message----- can you use an IF function (or any function) to return a value if a certain cell contains a formula as opposed to an inputted value. I would like to be able to see this indicator on a printout out of the spreadsheet. Thanks . |
#4
![]() |
|||
|
|||
![]()
Jason Morin wrote...
You can't do it directly with a worksheet formula, but a simple UDF would work. Something like: Function IsFormula(Cell As Range) As String If Cell.HasFormula = True Then IsFormula = "Formula" Else IsFormula = "" End If End Function .... Obtuse! The OP wants to do something other than show Formula or not. Didn't occur to you just to return the value of the range's .HasFormula property? |
#5
![]() |
|||
|
|||
![]()
Yes, simply returning a TRUE or FALSE occurred to me. But
if you're sharing the worksheet with others, such as a boss, it's more time-consuming to explain TRUE or FALSE then "Formula" and "". -----Original Message----- Jason Morin wrote... You can't do it directly with a worksheet formula, but a simple UDF would work. Something like: Function IsFormula(Cell As Range) As String If Cell.HasFormula = True Then IsFormula = "Formula" Else IsFormula = "" End If End Function .... Obtuse! The OP wants to do something other than show Formula or not. Didn't occur to you just to return the value of the range's .HasFormula property? . |
#6
![]() |
|||
|
|||
![]()
Jason Morin wrote...
Yes, simply returning a TRUE or FALSE occurred to me. But if you're sharing the worksheet with others, such as a boss, it's more time-consuming to explain TRUE or FALSE then "Formula" and "". .... The prototypical pointy-haired boss who doesn't understand the explanations? Now, since you named the formula IsFormula, and since there are several built-in functions (in English language versions) beginning with IS that return True/False, just how pig-headed do you believe these co-workers are? Silly me believing that semantic consistency with similarly named, similarly used built-in functions would cause less trouble in the long run. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can a Formula in Cell X modify Cell Y? | Excel Discussion (Misc queries) | |||
Cell shows formula and not the result of the formula. | Excel Worksheet Functions | |||
looking for a formula | Excel Worksheet Functions | |||
I want the results of a formula to show in cell, NOT THE FORMULA! | Excel Discussion (Misc queries) | |||
How do I do math on a cell name in formula? | Excel Worksheet Functions |