+ Reply to Thread
Results 1 to 12 of 12

How can I tell a formula from a number?

  1. #1
    Registered User
    Join Date
    04-28-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    1

    How can I tell a formula from a number?

    Is there an excel function that can distinguish between a number and a formula?

    A cell contains a default formula, but this can be overridden with a specific number.

    I want to set up a conditional format rule to change the cell color when a number is typed over the formula.

    Thanks

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: How can I tell a formula from a number?

    This can be done with a worksheet change event(VBA)
    Please Login or Register  to view this content.
    When a number is entered in that range, the cell will change color
    The code goes in the worksheet module

  3. #3
    Valued Forum Contributor
    Join Date
    02-08-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2007
    Posts
    122

    Re: How can I tell a formula from a number?

    I hope this is clear,

    1.- Select Cell A1
    2.- Create a name called IsFormula
    3.- In the Refer to: box type this =GET.CELL(48,!A1)
    4.- Select the cells where you want the conditional formating
    5.- Select Use a formula to determine which cells to format
    6.- In the Format values where this formula is true box type =IsFormula
    7.- Select the format you want to use.


    Regards

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: How can I tell a formula from a number?

    That's cool, but the OP wants to Highlight the cells that are not a Formula.
    Maybe attach an example....

  5. #5
    Valued Forum Contributor
    Join Date
    02-08-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2007
    Posts
    122

    Re: How can I tell a formula from a number?

    Quote Originally Posted by davesexcel View Post
    The OP wants to Highlight the cells that are not a Formula.
    Then use =IsFormula=FALSE for the condition.

    Example attached.

    Regards

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: How can I tell a formula from a number?

    Hmm...
    Interesting, when I open your workbook I am warned that there are macro4 in the workbook, I opened it anyway, when I changed the formula cells to a simple number nothing changed.
    Why would I be told the workbook has Macro4, in it?

  7. #7
    Valued Forum Contributor
    Join Date
    02-08-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2007
    Posts
    122

    Re: How can I tell a formula from a number?

    Quote Originally Posted by davesexcel View Post
    Why would I be told the workbook has Macro4, in it?
    Because Get.Cell is part of the old XLM Excel macros functions.

    Quote Originally Posted by davesexcel View Post
    when I changed the formula cells to a simple number nothing changed
    Press Page Down once when you open book, back to A1, then play with cells with CF.

    Regards

  8. #8
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: How can I tell a formula from a number?

    Nope, I won't do that, I will not do anything with XLM Excel macros, and don't expect anybody else to either...
    Why did you not explain that when you posted the Workbook?
    Last edited by davesexcel; 04-28-2010 at 11:15 PM.

  9. #9
    Valued Forum Contributor
    Join Date
    02-08-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2007
    Posts
    122

    Re: How can I tell a formula from a number?

    Quote Originally Posted by davesexcel View Post
    Nope, I won't do that, I will not do anything with XLM Excel macros, and don't expect anybody else to either...
    What is the problem with them? I have seen some DonkeOte's answers using them. If I'm not wrong they are now incorporated in VBA Office 2010.

    Regards

  10. #10
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: How can I tell a formula from a number?

    You indicated to use Conditional formatting for the solution..
    Where in the post with your attachment does it say, "Press Page Down once when you open book, back to A1, then play with cells with CF."?

    When you suggest to use Conditional Formatting, it may be assumed that Macros are not required.

  11. #11
    Valued Forum Contributor
    Join Date
    02-08-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2007
    Posts
    122

    Re: How can I tell a formula from a number?

    Quote Originally Posted by davesexcel View Post
    Where in the post with your attachment does it say, "Press Page Down once when you open book, back to A1, then play with cells with CF."?
    It's just to calculate the formula once, it will be the same if you press F9.

    Regards

  12. #12
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: How can I tell a formula from a number?

    Dave this may help you be confortable with this solution:

    http://www.j-walk.com/ss/excel/usertips/tip045.htm
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1