+ Reply to Thread
Results 1 to 6 of 6

If/Then Formulas with text

  1. #1
    Registered User
    Join Date
    11-27-2009
    Location
    Virginia Beach, VA
    MS-Off Ver
    Excel 2003
    Posts
    3

    If/Then Formulas with text

    I haven't been using Excel long, still learning alot.

    I want to create a formula that returns a true/false answer based on text. I've figured out how to do a simple version of this with "=IF(F3="Q", 10, 5)". What I really need is a formula with multiple conditions so that a set of five-six text entrys (KS, KSV, DS, etc) returns one response, and another set (KQ, KQS, DQ, etc) returns another. I don't know if it's possible to ask the program to search within a text entry for one character (S vs. Q), or if the formula would just need to have each of the entrys of both sets in it.

    Is this formula possible? I've looked up some multiple conditions formulas, but as they all involve numbers I'm not sure how to rewrite them.
    Last edited by Kokoni; 11-27-2009 at 01:30 PM. Reason: solved problem

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: If/Then Formulas with text

    If, as it seems, the S & Q are mutually exclusive then perhaps:

    =IF(ISNUMBER(SEARCH("Q",F3)),10,5)

    (if you wish to make the test case sensitive (ie Q <> q) then use FIND rather than SEARCH)

  3. #3
    Registered User
    Join Date
    11-27-2009
    Location
    Virginia Beach, VA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Talking Re: If/Then Formulas with text

    Huzzah! It works! Thank you so much!

  4. #4
    Registered User
    Join Date
    08-28-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: If/Then Formulas with text

    I'm just going through threads looking for new formulas I don't currently use and saw the ISNUMBER. Granted its very self explanitory, but why use it in this case? Couldn't you simply have used

    =IF(SEARCH("Q",F3),10,5)

    and gotten the same results?

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: If/Then Formulas with text

    No. If Q does not exist in the string a #VALUE! error will be returned hence the subsequent ISNUMBER test (ie to evaluate Error status - not the position of Q itself should it exist)
    (always best to test)
    Last edited by DonkeyOte; 12-01-2009 at 01:14 PM. Reason: reworded

  6. #6
    Registered User
    Join Date
    08-28-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: If/Then Formulas with text

    Ah okay. I actually did test it, but I tested it on a cell where the condition was TRUE. Thanks for clarification.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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