+ Reply to Thread
Results 1 to 5 of 5

macro formula to clean data in large file

  1. #1
    Registered User
    Join Date
    03-03-2014
    Location
    austin, texas
    MS-Off Ver
    Excel 2007
    Posts
    4

    macro formula to clean data in large file

    I am trying to use excel tools to clean dirty data and compare the two cells. The information is there but tainted with additional information that is not relevant. I have tried to use Left/Right tools to capture alpha characters leading an address number with no real success. I realize this is probably better served with VBA but I do not have those skills. If anyone has thoughts using macros or formulas, I would appreciate it. Also, when I get the data it seems to have some embedded breaks that I can't seem to get rid of that cause my tasks to error too.

    Thank you for your consideration. Brady
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: macro formula to clean data in large file

    Hello Brady, and welcome to the forums

    Hmmmmm, not quite the search for the holy grail but getting close i suspect.

    I suspect that you will probably need to provide a slightly larger sample file for those of us who are not familiar with USA address vagaries

    It also looks like you have a typo in Cell E4 (I know... picky picky )

    Jmac1947

    as a PS, how would we know which format is correct, why in E3 do you show Cir (I am guessing short for circle and therefore a street "Type" and in E4 you do not have the DR (drive) ??
    Last edited by jmac1947; 03-03-2014 at 10:56 PM. Reason: added the PS

  3. #3
    Registered User
    Join Date
    03-03-2014
    Location
    austin, texas
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: macro formula to clean data in large file

    jmac1947. Thanks for the quick reply. This is a nasty data set. I was actually just going to split all the characters together in the same cell separated by spaces in separate columns and do some sorting to figure it out. I have added a large sample for your review. The issue with the address data in each cell is that it is all over the place. I will use this to find addresses in the two separate columns that do not match. The issue is that some may read "101 main street, anywhere, USA" and the compared cell next to it may read "%debbie and jack trust 101 main ST (abbr for street), anywhere, USA".

    Also, one cell may have breaks in it to format the address correctly and the other may not. "Typically" US addresses are formatted '101 Main ST, Dallas, TX'. I removed the commas onthis sample as they were also inconsistent. So, I have been crash coursing VBA today and still beating my head against the wall trying to break all this data in the cells into separate cells and then I can do manual work to filter out matches or near matches. BTW, I have many of these files from different entities and they are all different but have the same issues. I need a data loader that I can map the cells to and load it into a database but that is above my ability. Any suggestions would be greatly appreciated.

    In the end, I need to be able to match the data in the opposing address cells beside each other and see if there are matches in the nasty added data.

    Thank you again, I plan to be her often as I am totally amazed at what can be done with VBA and I have to learn it now. Thank you, B
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: macro formula to clean data in large file

    Hi Brady,

    You are not kidding when you say "nasty", this is serious hard work in spades.

    OK, I cannot promise anything but I will give it some tries. As a first step I will try to get a "generic" split of the data into individual cells, that shouldn't be tooooo bad (famous last words I can hear my self saying already )'

    This could end up being the death of both of us but it may also be a bit of fun along the way (I feel better already knowing I am going to have fun )

    John (aka jmac1947)

  5. #5
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: macro formula to clean data in large file

    Hi Brady,

    Time for an update on progress.

    I currently have some code that will recognise approx 62% of the data as "matched" and think it is time for you to review it to see if I am on the right trail.

    You will see that in many cases I am looping through the data in the same way, this is because I have been building one "try this now process" at a time and have not gone back to try to speed up the overall process... motto... get it working correctly first and then worry about the speed issue when the time it takes starts to irritate you

    I have not altered any data in Col A or Col B, instead I have copied the data over into Col E & Col F to manipulate.

    I have also split out the individual components of each original cell for reach row as well which may be useful later.

    I was about to start on the "compass points" checking (ie 120 W 42nd Street Anywhere TX vs 120 42nd Street Anywhere TX type matches) but that can wait until you review the current progress.

    There is still more to go I think

    The forum has a file size limit that we have currently exceeded, I figure it would be good for you to see all the results so I will email you off line

    Cheers

    Jmac1947

    1. Please consider clicking on the * Add Reputation if you think this post has helped you
    2. Mark your thread as SOLVED when question is resolved

+ 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] Macro to Clean Excel File
    By VKS in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-04-2012, 06:49 AM
  2. [SOLVED] VBA Code to optimize and clean data- clean out numerical/ or symbol
    By tracylsr in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-05-2012, 04:21 PM
  3. Replies: 1
    Last Post: 04-02-2011, 06:39 AM
  4. Macro to create pivot table from large data file
    By johnson748r in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-27-2007, 02:36 PM
  5. [SOLVED] Utility to "clean up" or "defrag" large Excel file
    By Sabrina in forum Excel General
    Replies: 3
    Last Post: 01-12-2006, 06:00 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