+ Reply to Thread
Results 1 to 5 of 5

Formula to Return Text Result Based On Text Contained in Cell

  1. #1
    Registered User
    Join Date
    02-10-2021
    Location
    Iowa, USA
    MS-Off Ver
    2019
    Posts
    10

    Formula to Return Text Result Based On Text Contained in Cell

    I need a formula to lookup text in a cell & return a set result in another cell.

    So if D2 contains the abbreviation "BA", F2 would say BA, if D2 contains the abbreviation "MA", F2 would say MA.

    Any help would be appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Formula to Return Text Result Based On Text Contained in Cell

    try
    =IF(COUNTIF(D2,"*BA*"),"BA",IF(COUNTIF(D2,"*MA*"),"MA",""))
    you could use a MATCH

    And various other ways to solve, but this is how i would solve
    Attached Files Attached Files
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    02-10-2021
    Location
    Iowa, USA
    MS-Off Ver
    2019
    Posts
    10

    Re: Formula to Return Text Result Based On Text Contained in Cell

    That worked perfectly. Thank you so much for your help! I'll mark the post as solved.

  4. #4
    Registered User
    Join Date
    07-02-2013
    Location
    Cheshire
    MS-Off Ver
    Office Professional 2007
    Posts
    79

    Re: Formula to Return Text Result Based On Text Contained in Cell

    Hi there and welcome. Try this formula in F2: =IF(ISERROR(FIND("BA",D2)),IF(ISERROR(FIND("MA",D2)),"","MA"),"BA")

    John

  5. #5
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Formula to Return Text Result Based On Text Contained in Cell

    you are welcome , as mentioned loads of different ways to solve , including match/find etc

+ 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. Formula needed: Averages per user based on text contained in another cell
    By aspofford in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-06-2020, 12:30 PM
  2. [SOLVED] Match 2 different text strings both contained in a cell, return value
    By excelforumkeys in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-19-2018, 05:08 PM
  3. [SOLVED] If cell contains text contained in a named range return the row number
    By spoursy in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-05-2014, 05:54 AM
  4. Need help with a date comparison formula - Return text based on result
    By kcleere in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-16-2013, 03:58 PM
  5. [SOLVED] Return specific text if a different text is contained anywhere in a range of cells
    By ciayers in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-06-2013, 05:54 PM
  6. [SOLVED] Can not figure out how to color cells based on the text contained in the cell
    By Kjorg in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-07-2012, 07:00 PM
  7. Formula using text contained in a cell as criteria
    By Darik777 in forum Excel General
    Replies: 3
    Last Post: 10-20-2010, 10:03 AM

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