+ Reply to Thread
Results 1 to 14 of 14

Find a particular text within a cell

  1. #1
    Forum Contributor
    Join Date
    12-03-2020
    Location
    australia
    MS-Off Ver
    365
    Posts
    108

    Find a particular text within a cell

    Hi,

    I'm trying to tag a column based on what is written in that cell. For example:

    Screenshot 2023-01-01 174208.png

    As you can see, I have column A with description and column B as my desired result.

    I want to go down column A and identify any words/strings that matches my key list. Once it matches it, it return the key as a tag.

    I'm currently using nested IFS but its starting to get out of hand.

    Please Login or Register  to view this content.
    Thank you for your help
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Find a particular text within a cell

    1. Ensure all terms are consistently separated (, ).

    2. Delete all expected results.

    3. Use a dynamic array to spill the results down:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 01-01-2023 at 05:33 AM.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Contributor
    Join Date
    12-03-2020
    Location
    australia
    MS-Off Ver
    365
    Posts
    108

    Re: Find a particular text within a cell

    Hi Glenn,

    Thank you for your response.

    I can't seem to download the workbook.

    Edit: all fixed!

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Find a particular text within a cell

    Fixed = downloaded, or = downloaded and it works??

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

    Re: Find a particular text within a cell

    Another option:

    Please try
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    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,396

    Re: Find a particular text within a cell

    Here is an improved version of the formula:

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

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Find a particular text within a cell

    Sitting on a damp Sunday afternoon - with bags under my eyes after a late, late night... with the gentlest of headaches - is perhaps not the best time to try to understand recursive lambda functions!!

    This is non-recursive.. and I understand it... and it's far better than my first effort. But not as nice as yours, Hans, at Post 6.

    =BYROW(A2:A9,LAMBDA(x,INDEX(E2:E4,MAX(IF(ISNUMBER(SEARCH(TEXTSPLIT(TEXTJOIN("|",,F2:F4),", ","|"),x)),SEQUENCE(ROWS(E2:E4)),"")))))
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    12-03-2020
    Location
    australia
    MS-Off Ver
    365
    Posts
    108

    Re: Find a particular text within a cell

    at first i couldn't download it, but it worked.

  9. #9
    Forum Contributor
    Join Date
    12-03-2020
    Location
    australia
    MS-Off Ver
    365
    Posts
    108

    Re: Find a particular text within a cell

    im noticing, when i use multiple words to search eg animal = dog,cat,rat,bat etc it fails to pick some and depending on the order.

    I've attached a sample data i was experimenting with...

    I basically changed the order of my key and it failed to pick it up. Depending on the order I put it, it picks it up. ??


    Screenshot 2023-01-02 100056.png

    Edit: Please ignore, I noticed the problem. I need, its a spacing issue. need dog, cat, snake etc
    Attached Files Attached Files
    Last edited by bob112233; 01-01-2023 at 07:17 PM.

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

    Re: Find a particular text within a cell

    its a spacing issue. need dog, cat, snake
    Indeed, Glenn also explicitly stated:
    1. Ensure all terms are consistently separated (, )
    And that applies to all formulas.

    You are welcome, thanks for the feedback and rep .

  11. #11
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Find a particular text within a cell

    just for fun

    with Power Query

    Description Tag
    ksdjfhsk cat idshofsih Animal
    dog - @hgios Animal
    hsodfhs -snake 1231 Animal
    oihdsd Burj Khalifa 556 Building
    Opera House 889 Building
    George 33Human Human
    9302 @- ADAM 0jdj Human
    Parrot 9393 Animal

  12. #12
    Registered User
    Join Date
    01-02-2023
    Location
    Florida
    MS-Off Ver
    Office 365 v2211
    Posts
    4

    Re: Find a particular text within a cell

    Recursive lambdas in Excel functions. Who would have guessed that 15 years ago?..

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Find a particular text within a cell

    Even now... hangover gone... I don't really understand them!!

  14. #14
    Registered User
    Join Date
    01-02-2023
    Location
    Florida
    MS-Off Ver
    Office 365 v2211
    Posts
    4

    Re: Find a particular text within a cell

    yeah, one main problem with them is debugging... you cant easily see how many times the recursion happened.

+ 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] Find string of text within a cell and then replace the cell with new text
    By major_johnson in forum Excel General
    Replies: 9
    Last Post: 04-22-2022, 07:59 AM
  2. Replies: 4
    Last Post: 08-28-2018, 12:40 PM
  3. Replies: 3
    Last Post: 02-14-2014, 08:08 AM
  4. Formula to find and return text string within a cell full of text strings
    By LightingPop in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-03-2013, 11:45 PM
  5. [SOLVED] Trying to find a formula to find a random $ amount in a text in a cell
    By Miki1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-28-2013, 10:13 PM
  6. Replies: 7
    Last Post: 01-24-2013, 06:55 PM
  7. open some txt files ,find text , copy the text before that to a single cell
    By gus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2005, 01:05 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