+ Reply to Thread
Results 1 to 7 of 7

how to combine phrases - remove duplicates - and remove words with specific length

  1. #1
    Registered User
    Join Date
    06-30-2018
    Location
    Chicago
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    14

    Lightbulb how to combine phrases - remove duplicates - and remove words with specific length

    The problem I have is simple for a human to solve, but I'm having a hard time figuring out how to make excel do the same thing.

    I have phrases in each cell B2:F2

    ...and what I want to do is the following:

    take all of the individual words between B2:F2
    remove duplicate words
    remove words under 4 characters long
    take remaining words and post one word per cell between I2:R2

    I have en example in the excel file that shows the outcome I would like to have excel give.

    Thank you for the help
    Attached Files Attached Files
    Last edited by niktodorov1; 10-19-2018 at 02:34 PM. Reason: edit title

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: simple problem for human - hard in excel

    title updated
    Last edited by protonLeah; 10-19-2018 at 05:44 PM.
    Ben Van Johnson

  3. #3
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: simple problem for human - hard in excel

    Here is how I would do this:

    B4 =TRIM(MID(SUBSTITUTE(B$2," ",REPT(" ",LEN(B$2))),(ROWS($1:1)-1)*LEN(B$2)+1,LEN(B$2)))
    Drag through F4 then down as far as needed. I went through row 10.

    H2 =INDIRECT(TEXT(MIN(IF((B$4:F$10<>"")*(COUNTIF(H$1:H1,B$4:F$10)=0),ROW($4:$10)*100+COLUMN(B:F),7^8)),"R0C00"),)&"" Ctrl Shift Enter
    Drag down as far as needed. I went through row 20.

    J2 =IFERROR(INDEX($H:$H,SMALL(IF(LEN($H2:$H100)>3,ROW($H2:$H100)),COLUMNS($A:A))),"") Ctrl Shift Enter
    Drag to the right as far as needed. I went through column S.

    See attachment.

    Source:
    https://www.extendoffice.com/documen...e-columns.html
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    06-30-2018
    Location
    Chicago
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    14

    Re: simple problem for human - hard in excel

    I'm not sure how I would apply this on bigger scale once I have multiple rows of phrases that would need to be transformed as well.

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: how to combine phrases - remove duplicates - and remove words with specific length

    This is very long formula, other might have shorter one.

    I2 press Ctrl+Shift+Enter then drag to R2 and drag down

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

  6. #6
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: how to combine phrases - remove duplicates - and remove words with specific length

    Much simpler solution (compared to post #3):

    H2 =TRIM(MID(SUBSTITUTE(B$2&" "&C$2&" "&D$2&" "&E$2&" "&F$2," ",REPT(" ",1000)),(ROWS($1:1)-1)*1000+1,1000))
    Dragged down as far as needed.

    J2 =IFERROR(INDEX($H2:$H100,MATCH(0,IF(LEN($H2:$H100)>3,COUNTIF($I2:I2,$H2:$H100),""),0)),"") Ctrl Shift Enter

    Dragged to the right as far as needed.

    See attachment.

    Edit: I just saw post #5. Very nice. I would go with that solution over mine.
    Attached Files Attached Files
    Last edited by 63falcondude; 10-19-2018 at 02:44 PM.

  7. #7
    Registered User
    Join Date
    06-30-2018
    Location
    Chicago
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    14

    Re: how to combine phrases - remove duplicates - and remove words with specific length

    Quote Originally Posted by Bo_Ry View Post
    This is very long formula, other might have shorter one.

    I2 press Ctrl+Shift+Enter then drag to R2 and drag down

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    thank you that works perfectly

+ 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] Hard Excel Problem
    By simbalyon303 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-30-2014, 08:09 AM
  2. Simple for you probably but hard for me
    By BrandonDassow in forum Outlook Formatting & Functions
    Replies: 1
    Last Post: 09-29-2011, 10:01 PM
  3. [SOLVED] [HELP WITH ARRAY] Simple for you, very hard for me....please
    By Alex in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-15-2006, 03:55 AM
  4. Simple for you hard for me (newbie alert)
    By NathanS in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-15-2005, 01:05 PM
  5. Simple yet so hard. I need some help.
    By NavyAO1 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 01-23-2005, 09:13 PM
  6. Simple data/Hard statistics
    By David in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-10-2005, 01:06 AM
  7. [SOLVED] Simple data/Hard statistics
    By David in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-09-2005, 06:06 PM

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