Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
chopsx7
 
Posts: n/a
Default indicate whether a cell contains a formula

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   Report Post  
Bob Phillips
 
Posts: n/a
Default

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   Report Post  
Jason Morin
 
Posts: n/a
Default

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   Report Post  
Harlan Grove
 
Posts: n/a
Default

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   Report Post  
Jason Morin
 
Posts: n/a
Default

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   Report Post  
Harlan Grove
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can a Formula in Cell X modify Cell Y? alMandragor Excel Discussion (Misc queries) 7 February 10th 05 09:51 PM
Cell shows formula and not the result of the formula. stumpy Excel Worksheet Functions 2 January 14th 05 04:44 PM
looking for a formula Amanda Excel Worksheet Functions 5 January 5th 05 07:37 AM
I want the results of a formula to show in cell, NOT THE FORMULA! ocbecky Excel Discussion (Misc queries) 4 December 10th 04 08:39 PM
How do I do math on a cell name in formula? Mark Mulik Excel Worksheet Functions 3 November 23rd 04 03:43 PM


All times are GMT +1. The time now is 09:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"