+ Reply to Thread
Results 1 to 11 of 11

How to extract unique words from sentence into column?

  1. #1
    Forum Contributor
    Join Date
    12-20-2016
    Location
    Uzbekistan
    MS-Off Ver
    2016
    Posts
    189

    Question How to extract unique words from sentence into column?

    Hi Excel Gurus, i wonder if it possible to extract unique words from sentence into column?
    How to extract unique words from sentence into column.jpg

  2. #2
    Valued Forum Contributor than_gold's Avatar
    Join Date
    10-17-2017
    Location
    Coimbatore India
    MS-Off Ver
    Office 365
    Posts
    646

    Re: How to extract unique words from sentence into column?

    How did you define your unique words?
    Regards,
    Thangavel D

    Appreciate the help? CLICK *

  3. #3
    Forum Contributor
    Join Date
    12-20-2016
    Location
    Uzbekistan
    MS-Off Ver
    2016
    Posts
    189

    Re: How to extract unique words from sentence into column?

    not repeating words,

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: How to extract unique words from sentence into column?

    A UDF perhaps
    - test in attached workbook

    formula in B2 copied down
    =UniqueWordsOnly(A$2:A$11,ROW()-1)

    Note
    - the 2nd attribute should equate to 1 in the first cell
    (example if the first value is to appear in row 3, amend ROW()-1 to ROW()-2)
    - the range must be absolute
    (use $ to lock in row numbers)

    Sample result in attached workbook

    UniqueWords.jpg
    .

    The UDF
    - most punctuation marks are removed
    - strings converted to lower case

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kev_; 03-20-2018 at 08:53 AM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: How to extract unique words from sentence into column?

    This is quite simple, using Power Query (Get & Transform Data)

    Please Login or Register  to view this content.
    See attached workbook for worked example.
    Attached Files Attached Files
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  6. #6
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: How to extract unique words from sentence into column?

    @Olly
    Your PowerQuery option seems the most efficient solution
    - is it possible to refine it so that words are not duplicated if followed by punctuation marks?

    In this example "help" is listed 4 times:
    Olly.jpg
    Last edited by kev_; 03-20-2018 at 09:58 AM.

  7. #7
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: How to extract unique words from sentence into column?

    Yep - little bit more complex, but here's one way:
    Please Login or Register  to view this content.
    With a nod to Chris Webb: https://blog.crossjoin.co.uk/2014/08...n-power-query/

    I've added a couple of extra tweaks, so it counts the maximum number of words before splitting into columns (to improve performance), and handles multiple spaces (for example, where source contains "this - value").

  8. #8
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: How to extract unique words from sentence into column?

    @Olly Thanks - superb

  9. #9
    Forum Contributor
    Join Date
    12-20-2016
    Location
    Uzbekistan
    MS-Off Ver
    2016
    Posts
    189

    Re: How to extract unique words from sentence into column?

    Thank you for your answer, i should learn UDF from you!

  10. #10
    Forum Contributor
    Join Date
    12-20-2016
    Location
    Uzbekistan
    MS-Off Ver
    2016
    Posts
    189

    Re: How to extract unique words from sentence into column?

    Olly, could You recommend a source to learn better Power Query ? )

  11. #11
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: How to extract unique words from sentence into column?

    Thanks for the rep
    If we have answered your original question .. please mark thread SOLVED (ThreadTools@TopOfThread)
    thanks

+ 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. Extract a Sentence, That Contain One of these Words, from Text
    By Neyme in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-20-2014, 11:10 AM
  2. [SOLVED] How to extract first few words from a sentence - Help please
    By rehana357 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-06-2013, 04:09 AM
  3. Help! Count how many words in a sentence match a dictionary of words
    By sonyaelis in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-06-2013, 05:31 AM
  4. words matching in sentence
    By sailesh9630 in forum Excel General
    Replies: 8
    Last Post: 06-22-2011, 11:19 AM
  5. Separating a sentence into words?
    By Florinnn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-24-2010, 03:22 PM
  6. separate words from the sentence
    By darkhangelsk in forum Excel General
    Replies: 5
    Last Post: 11-16-2009, 09:59 AM
  7. extract last three words from sentence
    By wheelscpa in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-19-2008, 07:52 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