+ Reply to Thread
Results 1 to 6 of 6

Return Text From a Cell if It Contains One of Many Texts

Hybrid View

ScardiB Return Text From a Cell if It... 11-23-2022, 05:07 PM
sandy666 Re: Return Text From a Cell... 11-23-2022, 05:53 PM
ScardiB Re: Return Text From a Cell... 11-28-2022, 12:48 PM
sandy666 Re: Return Text From a Cell... 11-28-2022, 12:57 PM
Glenn Kennedy Re: Return Text From a Cell... 11-28-2022, 01:12 PM
Glenn Kennedy Re: Return Text From a Cell... 11-28-2022, 01:17 PM
  1. #1
    Registered User
    Join Date
    05-26-2021
    Location
    California
    MS-Off Ver
    MS 365
    Posts
    8

    Return Text From a Cell if It Contains One of Many Texts

    I have a list of campaigns that contain multiple texts in each cell. I want to pull out a word from the cell but the text is not always in the same position or always between the same characters.

    In the attached sheet I have 6 campaigns and I need to pull out specific words. If A2:A7 contains "Vegetable" then in column B I want it to say Vegetable, if in column A in says "Fruit", in column B write "Fruit", and so on.

    Should I create a list of what I want to extract and use that? Like Column C has a list of the text options I want to pull out (Vegetable, Fruit, Dairy, Grain, Cheese, Corn)

    Hope that makes sense.
    Attached Files Attached Files

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

    Cool Re: Return Text From a Cell if It Contains One of Many Texts

    like this ?
    (with Power Query)

    Campaign Criteria Campaign Criteria
    brand category Vegetable intent exact Vegetable, Fruit, Dairy, Grain, Cheese, Corn brand Vegetable category intent exact Vegetable
    brand Fruit intent exact brand Fruit intent exact Fruit
    brand category Dairy intent exact brand category Dairy intent exact Dairy
    brand option Grain affinity exact brand option Grain affinity exact Grain
    brand category Cheese intent exact brand category Cheese intent exact Cheese
    brand option 2 Corn custom exact brand option 2 Corn custom exact Corn

  3. #3
    Registered User
    Join Date
    05-26-2021
    Location
    California
    MS-Off Ver
    MS 365
    Posts
    8

    Re: Return Text From a Cell if It Contains One of Many Texts

    Yes, like that. Is there a formula that can help pull that out?

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

    Re: Return Text From a Cell if It Contains One of Many Texts

    not formula but Power Query
    Data tab - Show Queries - dbl click on any table - Advanced Editor

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

    Re: Return Text From a Cell if It Contains One of Many Texts

    One way:

    =IFERROR(LOOKUP(1E+100,FIND($G$1:$G$6,A2),$G$1:$G$6),"")
    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

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

    Re: Return Text From a Cell if It Contains One of Many Texts

    Or, since you have O365, a SPILL array that does it all in a single cell:

    =BYROW(A2:A7,LAMBDA(x,LOOKUP(1E+100,FIND(G1:G6,x),G1:G6)))
    Attached Files Attached Files

+ 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] Return all texts where the adjacent cell is >0
    By Enounce in forum Excel General
    Replies: 9
    Last Post: 03-06-2021, 03:21 PM
  2. Replies: 9
    Last Post: 05-03-2020, 03:01 AM
  3. Replies: 11
    Last Post: 04-09-2019, 09:50 AM
  4. Search for several texts and return a spesific text
    By mariur89 in forum Excel General
    Replies: 2
    Last Post: 11-24-2014, 07:37 PM
  5. Search for multiple texts in cell, return specific text
    By mariur89 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 11-24-2014, 06:43 PM
  6. Replies: 10
    Last Post: 09-18-2014, 09:36 AM
  7. Search the text in 3rd cell by using texts in 2 cells
    By Shinaj in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-09-2014, 08:08 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