+ Reply to Thread
Results 1 to 10 of 10

Search cell text for specific values

  1. #1
    Registered User
    Join Date
    09-04-2012
    Location
    Texas
    MS-Off Ver
    Excel 2016, 2019
    Posts
    53

    Search cell text for specific values

    I am trying to find specific text in a cell then based on the text identify the item.

    the formula I have partially works, I can get it to identify the item if is exactly as stated in formula.

    =IFS(A2="serv123","SERVER",A2="wksta123","WORKSTATION",A2="lptp123","LAPTOP",A2="tblt123","TABLET",A2="iph123","PHONE",TRUE,"")

    I understand the formula is specifically seeking the text, but I need to find it anywhere in cell

    Any assist would be appreciated
    Attached Files Attached Files
    Last edited by jaycee66; 06-07-2023 at 09:48 PM.

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Search cell text for specific values

    this would be one way...
    =IFERROR(IFS(ISNUMBER(SEARCH("serv123",A2)),"SERVER",ISNUMBER(SEARCH("wksta123",A2)),"WORKSTATION",ISNUMBER(SEARCH("lptp123",A2)),"LAPTOP",ISNUMBER(SEARCH("tblt123",A2)),"TABLET",ISNUMBER(SEARCH("iph123",A2)),"PHONE"),"")
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    09-04-2012
    Location
    Texas
    MS-Off Ver
    Excel 2016, 2019
    Posts
    53

    Re: Search cell text for specific values

    Sam, Thank you for the quick assist. It was driving me crazy. Tried the "search" function but couldn't get the right syntax

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Search cell text for specific values

    Glad I could help, AND thank you for the rep!

  5. #5
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Search cell text for specific values

    IMO, I would like to create table of Search and Result and use vlookup (or Index / Match) or others functions instead of IF (Excel 2016 didn't support IFS).
    Because I can add more Search and Result when needed.

    From your sample file.
    I've create table at H3:I7

    and use this formula at row 2
    =INDEX($I$3:$I$7,AGGREGATE(15,6,(ROW($H$3:$H$7)-ROW($H$2))/(1/FIND($H$3:$H$7,A2)>0),1))

    Regards.
    Attached Files Attached Files

  6. #6
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,428

    Re: Search cell text for specific values

    Another way, please try
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,428

    Re: Search cell text for specific values

    Or with a table (as menem has done), please try
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Search cell text for specific values

    In B2, copied down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This formula could easily reference a table instead of literal arrays. That would simplify upkeep if you need to change lookup or return values.
    Last edited by leelnich; 06-07-2023 at 10:22 PM.
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

  9. #9
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Search cell text for specific values

    Quote Originally Posted by HansDouwe View Post
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Hans - I really like your use of SIGN here. But why is everyone using FIND, which is case sensitive, instead of SEARCH, which is not?

  10. #10
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,423

    Re: Search cell text for specific values

    Cell B2 formula , Drag down

    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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. Search Tab for specific text, then offset from the cell containing that text
    By exceltrainee314 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-20-2022, 03:33 AM
  2. Replies: 10
    Last Post: 10-24-2020, 01:05 AM
  3. [SOLVED] Search a cell for a specific text
    By williamkwells in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-12-2020, 05:05 PM
  4. [SOLVED] Search many workbooks for specific text, then insert a text in adjacent cell
    By MDW12 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-26-2017, 02:08 PM
  5. Web Query - Search for Specific Text and paste values
    By tuckertheguy in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-14-2015, 07:26 AM
  6. [SOLVED] To search specific text in a cell that contains text string
    By mikail in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-15-2013, 03:02 PM
  7. [SOLVED] How do I search for specific text and sum the cell to the right?
    By PacRat2001 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-12-2005, 12:05 AM

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