+ Reply to Thread
Results 1 to 17 of 17

Formula to Unify Text Entries in the Same Column

  1. #1
    Forum Contributor
    Join Date
    10-06-2013
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Excel 2010
    Posts
    208

    Formula to Unify Text Entries in the Same Column

    Dear Friends,

    In the attached sheet, column B and E contain hand-entered data as part of voluntary basic information of an extensive questionnaire (sample of 950 questionnaire).

    When using pivot table to group entries to summarize results, the pivot table treats (as expected) each misspelled entries or each unique word or words with extra spaces as categories.

    I am looking for an innovative formula that I can enter in column C2 and then copy it down to unify entries and produce the “Ideal” outcome in column C.

    My dream is that the formula to enter in C2 will look at the first entry in B2 (the word YEMENI in the sheet), then look for similar entries in the remaining of column B, find the similar word YEMEN in B8, then it enters the value of B2 (YEMENI) in both, C2 and C8. Then the formula will look in B3 ...

    I am sure that I will still have to do some manual work and visually compare B and C , but I hope the formula will help. The actual data contains 13 columns and 950 rows
    Many thanks in advance, Taisir

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Formula to Unify Text Entries in the Same Column

    See if this will help at all? It is based on taking the 1st x-number of characters on the word, and then looking for a match with that, in the list below. The "x" can be adjusted so you can play with it and see what tolerances suite you best.

    =INDEX(B3:$B$32,MATCH(LEFT(B2,$D$1)&"*",B3:$B$32,0))
    copied down
    I put "x" in D1
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    10-06-2013
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Excel 2010
    Posts
    208

    Re: Formula to Unify Text Entries in the Same Column

    Quote Originally Posted by FDibbins View Post
    See if this will help at all? It is based on taking the 1st x-number of characters on the word, and then looking for a match with that, in the list below. The "x" can be adjusted so you can play with it and see what tolerances suite you best.

    =INDEX(B3:$B$32,MATCH(LEFT(B2,$D$1)&"*",B3:$B$32,0))
    copied down
    I put "x" in D1
    Dear FDibbins
    Many thanks for the prompt reply athough the lateness in your time zone

    I experimented with the formula with 3 in D1
    It misses 11 out of the 31. Most of the misses are obvious such as B8, B9, B23, B29. It seems also that the formula also misses duplicates in B such as B23 and B24.

    Can I ask you please to see if we can adjust the formula? all the best

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Formula to Unify Text Entries in the Same Column

    Don't quote whole posts -- it's just clutter. If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding.

  5. #5
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    604

    Re: Formula to Unify Text Entries in the Same Column

    This seems to be a pretty big undertaking

    Replacing Yemen with Yemeni and then replacing Syriana with Syria are opposites. If this is a one-off, I'd sort the list by nationality and manually copy the names that you want.
    If it is an on-going problem, then maybe make up a vlookup on another sheet and everytime you get more data you can add any other unknowns to the list and it will learn more and more as you go.
    Eventually, it will be able to correct almost any mistake or variation that people can make.

    Just a thought

  6. #6
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    604

    Re: Formula to Unify Text Entries in the Same Column

    I don't think I worded that very well. So I'll attach an example of what I was talking about.

    Also did the same with the Colleges.
    Attached Files Attached Files
    Last edited by Beamernsw; 12-19-2015 at 06:54 AM.

  7. #7
    Forum Contributor
    Join Date
    10-06-2013
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Excel 2010
    Posts
    208

    Re: Formula to Unify Text Entries in the Same Column

    Thanks Beamernsw,
    Did I understand that you will attach a file, per your second post?

    Thanks

  8. #8
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    604

    Re: Formula to Unify Text Entries in the Same Column

    Sorry, I did, but I changed my mind on what I had so was in the middle of editing that post and replacing the file when you read it.

  9. #9
    Forum Contributor
    Join Date
    12-23-2003
    Posts
    179

    Re: Formula to Unify Text Entries in the Same Column

    @Beamernsw

    Row\Col
    B
    C
    1
    Nationality
    Ideal Nationality
    2
    YEMENI YEMENI
    3
    N/A N/A
    4
    TUNIS TUNIS
    5
    ALGERIA ALGERIA
    6
    ALGERIAN ALGERIA
    7
    TUNISIAN TUNIS
    8
    JORDANIAN JORDANIAN
    9
    YEMEN YEMENI


    In B2 enter and copy down:

    =IF(B2="","",IFERROR(LOOKUP(9.99999999999999E+307,SEARCH(LEFT($B$1:B1,LEN(B2)),B2),$C$1:C1),B2))

    This probably yields an admissible set...

  10. #10
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    604

    Re: Formula to Unify Text Entries in the Same Column

    Very nice Aladin. That only had 2 incorrect in the entire list and they were very close.

  11. #11
    Forum Contributor
    Join Date
    10-06-2013
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Excel 2010
    Posts
    208

    Re: Formula to Unify Text Entries in the Same Column

    Dear Aladin,
    Many thanks for your innovative formula which I used immediately and it worked great on the questionnaire project.

    I tried to use the same formula on another research I am doing on authors of scholarly published articles.

    Attached is the full file (public domain) and how the names are structured and imported. Many authors use slightly different names styles based on the journal requirement and sometimes their names are misspelled. This is why your great formula produce different results for the same author highlighted in yellow

    Can I ask you to look at the attached and advice whether the formula needs adjustment for this task or it is still valid as it is.

    Initial run of your formula picked about 4600 duplicates.

    Many thanks in advance Taisir
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    12-23-2003
    Posts
    179

    Re: Formula to Unify Text Entries in the Same Column

    @Taisir

    You did not supply the correct values the formula should produce. Judging from the variations the names appear to be associated with in your data, you might want to consider running a fuzzy matching routine like described in:

    1) http://www.microsoft.com/en-gb/downl....aspx?id=15011

    2) http://www.mrexcel.com/forum/excel-q...planation.html

  13. #13
    Forum Contributor
    Join Date
    10-06-2013
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Excel 2010
    Posts
    208

    Re: Formula to Unify Text Entries in the Same Column

    Dear Aladin,
    Many thanks for the prompt reply,
    Indeed, I am not sure how the data should look like since it is too big, but I applied your formula to similar names of scholars that I know and your formula produced the values in yellow. I thought based on the results of your formula in yellow, you can adjust the formula.

    I have the fuzzy match ad in from Microsoft but it is not applicable since it only fuzzy match two lists.

    I tried similar solution to the second link you provided with a demo available at https://www.youtube.com/watch?v=Gl1jKyfOIBw
    but it did not work for me. However, I must say that I tried it on another set of uncleaned data.

    Will look at the link and will try it on the new data set. will keep you posted. Thanks again
    Last edited by Taisir; 12-19-2015 at 05:07 PM.

  14. #14
    Forum Contributor
    Join Date
    12-23-2003
    Posts
    179

    Re: Formula to Unify Text Entries in the Same Column

    What should the formula return given those you colored in yellow?

    Row\Col
    A
    B
    1
    Serial
    Authors
    2
    26495
    AI-DEYAB, SS
    3
    1918
    AlDEYAB, S
    4
    1
    AlDEYAB, SS
    5
    721
    ALDEYAB, SS
    6
    25795
    AlDEYABAND, SS
    7
    25794
    AlDEYABC, SS
    8
    25793
    AlDEYABE, SS

  15. #15
    Forum Contributor
    Join Date
    10-06-2013
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Excel 2010
    Posts
    208

    Re: Formula to Unify Text Entries in the Same Column

    Dear Aladin,
    Many thanks again for your offer to help.

    There is some tedious work on my behalf that I need to do to clean the data from obvious and unnecessary prefixes and common space-adding common in Arabic Names.

    Once I arrive at the clean file, I will run your formula again and let you know, the result that the formula produces and the expected results.

    I must tell you, however, that your formula is a treasure for me so far.

    Take care and all the best.

  16. #16
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Formula to Unify Text Entries in the Same Column

    Perhaps 1 way to start the clean-up is to use the filter feature.

    Apply the filter, go into the drop-down and uncheck "ALL"
    Then check all the A's and see what can be cleaned there
    repeat with other letters as needed

  17. #17
    Forum Contributor
    Join Date
    10-06-2013
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Excel 2010
    Posts
    208

    Re: Formula to Unify Text Entries in the Same Column

    Dear Aladin,

    Following FDibbins suggestion and extensive manual cleaning, I arrived on cleanest list of names listed in Column C of the attached,

    I applied your formula for the first 150 names in Column D.

    In column E, I entered the expected/ideal outcome.

    Your formula produced 29 out of the 150 NOT IDEAL outcomes (highlighted in yellow for easy identification).

    Is there a room to adjust your formula in light of the attached?

    Also, I tried to apply the Fuzzy match solution available at http://www.mrexcel.com/forum/excel-q...planation.html on the attached list of 29K plus names. It took more than 16 hours to complete the first 10,000 names and I aborted the process.

    Thanks Taisir
    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. Creating an named range from a column of text entries
    By Matt6037 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-03-2015, 03:16 AM
  2. [SOLVED] Text to Column with entries on separate lines
    By vcheck in forum Excel General
    Replies: 5
    Last Post: 04-12-2014, 11:35 AM
  3. Suffixinf text to duplicate entries in a column
    By kshtjj in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-18-2013, 06:27 AM
  4. Replies: 4
    Last Post: 08-11-2013, 12:58 AM
  5. [SOLVED] How to unify random data in Excel
    By herukuncahyono in forum Excel General
    Replies: 7
    Last Post: 07-10-2013, 04:28 AM
  6. [SOLVED] column entries to continuous text
    By Firemaster in forum Outlook Formatting & Functions
    Replies: 2
    Last Post: 10-16-2012, 08:22 AM
  7. copy across a column with various text entries
    By acanavan in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-17-2007, 08:59 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