+ Reply to Thread
Results 1 to 9 of 9

Formula to determine IF a value has a specific number inside it

  1. #1
    Registered User
    Join Date
    11-06-2015
    Location
    Dallas
    MS-Off Ver
    Excel 2013
    Posts
    3

    Formula to determine IF a value has a specific number inside it

    Okay, this may be the craziest forum question you've ever seen, but it is a real life problem re: my boss. I am an estimator and put together quite lengthy bid spreadsheets. My boss is a superstitious man and never ever wants me to put together a bid where the grand total or sub-totals are values that contain both a 6 and a 9. A value can contain one or the other but not both. For example, the value $1,467,093 would be unacceptable because it has both a 6 & a 9 in it. I need a formula that will detect if a value contains 2 specific numbers and then format based on the result. If you have any help for me it would be very appreciated!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,544

    Re: Formula to determine IF a value has a specific number inside it

    This will highlight if the number contains 6 and 9:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    However, I'm not sure what you want to do about it. You could, if it were true, set the 6 to 5 or 7 and/or set the 9 to 0. Not sure what that does to, or says about, your estimate.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,544

    Re: Formula to determine IF a value has a specific number inside it

    With your example, $1,467,093, changing the 6 to a 5 or 7 would be minus or plus $10,000. What if it were $1,647,093? Changing the 6 to a 5 or 7 would be minus or plus $100,000.

  4. #4
    Registered User
    Join Date
    11-06-2015
    Location
    Dallas
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Formula to determine IF a value has a specific number inside it

    Yes, I can always manually change it, assuming I catch it. But I am looking for a formula that will automatically detect it and flag it for me. It doesn't have to change it, just detect it and flag it.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,544

    Re: Formula to determine IF a value has a specific number inside it

    And that's exactly what that formula does. It returns True or False. You can use that as it is, or in an IF statement, or in Conditional Formatting.

    See the example workbook attached.

    Regards, TMS
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-06-2015
    Location
    Dallas
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Formula to determine IF a value has a specific number inside it

    That's great. Thanks!

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,544

    Re: Formula to determine IF a value has a specific number inside it

    You're welcome.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  8. #8
    Forum Contributor Obsessed's Avatar
    Join Date
    05-22-2013
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 365
    Posts
    215

    Re: Formula to determine IF a value has a specific number inside it

    Quote Originally Posted by TMS View Post
    Not sure what that does to, or says about, your estimate.
    This made me LOL.
    Want to show appreciation for the help you received from a member? Give them reps by clicking the bottom left of their post!

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,544

    Re: Formula to determine IF a value has a specific number inside it

    What made me laugh was ...
    My boss is a superstitious man and never ever wants me to put together a bid where the grand total or sub-totals are values that contain both a 6 and a 9.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to get a number show up as 0 inside a formula.
    By mlbdc2012 in forum Excel General
    Replies: 11
    Last Post: 02-10-2015, 09:50 AM
  2. Trying to determine how many times something is used inside a time window on a date.
    By The Man With No Name in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-25-2013, 11:39 AM
  3. Require information on how a specific formula works (see inside for formula)
    By twiggywales in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-04-2012, 10:13 AM
  4. Replies: 3
    Last Post: 04-10-2012, 06:19 PM
  5. Formatting a number inside a formula
    By bopsgtir in forum Excel General
    Replies: 3
    Last Post: 10-28-2011, 09:21 AM
  6. Replies: 5
    Last Post: 02-11-2010, 05:13 PM

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