+ Reply to Thread
Results 1 to 2 of 2

How to check if a certain text is in a cell and then return a a value based on that.

  1. #1
    Registered User
    Join Date
    04-04-2019
    Location
    United States
    MS-Off Ver
    16
    Posts
    1

    How to check if a certain text is in a cell and then return a a value based on that.

    Sorry for the confusing title. Basically what I am trying to do is write a formula that checks to see if certain characters are in a cell like: the "NY" in "12.HCGS.453423..NY"

    And if there is an "NY" in that cell then return a certain value specific for "NY"


    So I think I would need a list of the things that I want returned based on a specific search such as:

    If the search finds "NY" then return "NYC"
    If the search finds "OK" then return "OKC"


    I am sorry if this is super confusing, I am trying to word it the best that I can. Let me know if I can help explain further and thank you for your help.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: How to check if a certain text is in a cell and then return a a value based on that.

    Hi, welcome to the forum

    Well, depending on how many different strings you would be searching for, you could use something like...
    =IF(ISNUMBER(SEARCH("ny",Q27)),"do this", "do that")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. [SOLVED] Check a column for text, then return corresponding cell's value
    By anderssd in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-27-2017, 12:01 PM
  2. [SOLVED] Check cell for text and return corresponding txt in adjacent cell
    By stu29 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-29-2014, 09:55 AM
  3. [SOLVED] Check to see if a cell contains text from a list then return the corresponding text
    By crousseau989 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-21-2013, 12:06 PM
  4. Replies: 2
    Last Post: 05-28-2013, 06:26 AM
  5. Check if cell range has value and return text
    By Postlki1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-20-2013, 04:52 AM
  6. Replies: 7
    Last Post: 12-09-2009, 08:47 PM
  7. Check Cell for any text and return a value
    By justoldme in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-15-2007, 01:51 PM

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