• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Search words in a cell and return all matching words|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Search words in a cell and return all matching words|General Excel Questions & Answers|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumGeneral Excel Questions & Answe…Search words in a cell and return a…
sp_PrintTopic sp_TopicIcon
Search words in a cell and return all matching words
Avatar
Nick Angadi

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
February 22, 2023
sp_UserOfflineSmall Offline
1
February 22, 2023 - 12:08 pm
sp_Permalink sp_Print sp_EditHistory

Hi, I saw Search a text string for a list of words but this did not solve my problem in excel for M365.

 

I have a column A with Strings and would like to return all matching words against a List in Column B.

 

For example,

My list is {"Bob","John","Smith"}

Cell A2 has: Bob and John went to dinner.  I want B2 as Bob, John

Cell A3 has: John, Bob and Smith went to dinner: I want B3 as John, Bob, Smith

Cell A4 has: Smith went alone for dinner. I want B4 as Smith

 

If this is not possible, at least the first matching name from the sentence has to be return. So B2 will be Bob, B3 as John and B4 as Smith. 

 

From the Blog, the ROW multiplication is not working and it is always returning sum.

Avatar
Riny van Eekelen
Örnsköldsvik, Sweden
Moderator
Members


Trusted Members

Moderators

Power BI
Level 0
Forum Posts: 440
Member Since:
January 31, 2022
sp_UserOfflineSmall Offline
2
February 22, 2023 - 4:34 pm
sp_Permalink sp_Print

In MS365, that would be:

=TEXTJOIN(", ",,FILTER(names,ISNUMBER(SEARCH(names,A2))))

where "names" is a named range containing the list of names.

The attached file contains an example.

The following users say thank you to Riny van Eekelen for this useful post:

Anders Sehlstedt
Avatar
Nick Angadi

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
February 22, 2023
sp_UserOfflineSmall Offline
3
February 23, 2023 - 7:58 am
sp_Permalink sp_Print

Hi Rinv,

Thanks for the reply. The formula worked, thanks. 

How to get the first matched word first rather than first in the array,

 

for example, B3 should be John, Bob, Smith as John is first match.

Avatar
Velouria
London or thereabouts
Moderator
Members


Trusted Members

Moderators
Level 4
Forum Posts: 613
Member Since:
November 1, 2018
sp_UserOfflineSmall Offline
4
February 23, 2023 - 8:40 am
sp_Permalink sp_Print

You could use something like:

=LET(counts,SEARCH(names,A2),TEXTJOIN(",",TRUE,CHOOSECOLS(SORT(FILTER(HSTACK(names,counts),ISNUMBER(counts)),2),1)))

Avatar
Nick Angadi

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
February 22, 2023
sp_UserOfflineSmall Offline
5
February 24, 2023 - 3:51 pm
sp_Permalink sp_Print

Thanks Velouria, it worked.

Avatar
Mike Green

Active Member
Members
Level 0
Forum Posts: 4
Member Since:
March 5, 2023
sp_UserOfflineSmall Offline
6
March 6, 2023 - 5:56 am
sp_Permalink sp_Print

Yessssss!

This works great for my problem.

Just needs a little more fine tuning.

The only part I need is this.

 

=FILTER(MonthResults,ISNUMBER(SEARCH(Months,A16)))

 

I am using this data (see Attachment ) and need to find exact match. Sometimes an abbreviation or code may be used in the field being searched. With the formula as is it is finding partial matches which is causing issues. I tried quotes around the named range etc. Nothing worked. 

 

Capture-3.PNGImage Enlarger

Thanks~

Mike G

sp_PlupAttachments Attachments
  • sp_PlupImage Capture-2.PNG (20 KB)
  • sp_PlupImage Capture-3.PNG (20 KB)
Avatar
Mike Green

Active Member
Members
Level 0
Forum Posts: 4
Member Since:
March 5, 2023
sp_UserOfflineSmall Offline
7
March 6, 2023 - 11:23 am
sp_Permalink sp_Print

Hello,

Problem solved. Found on another forum.

This was the code that worked for me.

=INDEX(SizeR,MATCH(TRUE,ISNUMBER(SEARCH(Size,A2)),0))

 

Thanks~

Mike G

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online:
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Ivica Cvetkovski
Blaine Cox
Shankar Srinivasan
riyepa fdgf
Hannah Cave
Len Matthews
Kristine Arthy
Michelle Neven
Andrew Kuhn
Angela Paul
Forum Stats:
Groups: 3
Forums: 24
Topics: 6206
Posts: 27202

 

Member Stats:
Guest Posters: 49
Members: 31875
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.