+ Reply to Thread
Results 1 to 11 of 11

Cleaning Data

  1. #1
    Forum Contributor sorensjp's Avatar
    Join Date
    12-23-2015
    Location
    Yokosuka, JP
    MS-Off Ver
    2016, 2019, 365
    Posts
    198

    Cleaning Data

    Hi,
    I'm looking to Clean some Data to ultimately be used for Pivot Table and Charts.

    The data I pull can be downloaded in .xlsx or .csv formats. The issue is cells containing dates or numbers show a date or numbers but in the formula bar have something similar to:
    ="01/05/2015" or ="0450"
    I want to remove the extra stuff leaving only the dates or numbers.

    The attached files are identical just the different formats.

    Also in the case of the number sets they will always have four digits. How do I format those cells to reflect the leading zeros like - 0450 vice 450 in the cell.

    Thank you in advance,

    Jim

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Cleaning Data

    1) Use the DATA > FROM TEXT feature to activate the Import Wizard.
    2) Select Delimited > Next > Comma > Next
    3) On the 3rd page, select the column(s) with date and choose the DATE option upper left, indicate if it is MDY or DMY
    4) Select the column(s) with numbers that you want the leading zeros to remain, select the TEXT option for those columns.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2503
    Posts
    13,707

    Re: Cleaning Data

    For the 3-4 digit numbers try using this custom format in format manager.

    0###
    Last edited by FlameRetired; 12-22-2016 at 11:25 PM.
    Dave

  4. #4
    Forum Contributor sorensjp's Avatar
    Join Date
    12-23-2015
    Location
    Yokosuka, JP
    MS-Off Ver
    2016, 2019, 365
    Posts
    198

    Re: Cleaning Data

    JB,

    Thank you for that. I had done that before but had forgotten about it.

    Jim

  5. #5
    Forum Contributor sorensjp's Avatar
    Join Date
    12-23-2015
    Location
    Yokosuka, JP
    MS-Off Ver
    2016, 2019, 365
    Posts
    198

    Re: Cleaning Data

    FlameRetired,

    I had tried that but not all 4 digit numbers lead have a Zero. Some of them have a number in the first position so that option doesn't work in this case.

    Jim

  6. #6
    Registered User
    Join Date
    09-09-2015
    Location
    India
    MS-Off Ver
    2010
    Posts
    65

    Re: Cleaning Data

    Hi sorensjp,

    PFA and PFB for the small macro. Paste this code in new module in Visual Basic Editor. Click on the sheet which contains the raw data and run this macro by pressing shortcut key ALT + F8. I hope this code will help.


    Please Login or Register  to view this content.
    Regards
    Ramandeep Singh
    Please Click * icon to Add Reputation if my answer helped!
    Attached Files Attached Files

  7. #7
    Forum Contributor sorensjp's Avatar
    Join Date
    12-23-2015
    Location
    Yokosuka, JP
    MS-Off Ver
    2016, 2019, 365
    Posts
    198

    Re: Cleaning Data

    Raman1667,

    This actually works nicely for me. I'm messing around with some my data to possibly create a dashboard. I don't have any idea what my end product might be that is if I get that far.

    Excel is so powerful and I'm still learning. Thank you for your help.

    Jim

  8. #8
    Registered User
    Join Date
    09-09-2015
    Location
    India
    MS-Off Ver
    2010
    Posts
    65

    Re: Cleaning Data

    Quote Originally Posted by sorensjp View Post
    Raman1667,

    This actually works nicely for me. I'm messing around with some my data to possibly create a dashboard. I don't have any idea what my end product might be that is if I get that far.

    Excel is so powerful and I'm still learning. Thank you for your help.

    Jim
    Thanks Jim,

    IF this problem is resolved, Kindly mark this question as solved.

    Thanks & Regards
    Ramandeep Singh
    Please Click * icon to Add Reputation if my answer helped!

  9. #9
    Forum Contributor sorensjp's Avatar
    Join Date
    12-23-2015
    Location
    Yokosuka, JP
    MS-Off Ver
    2016, 2019, 365
    Posts
    198

    Re: Cleaning Data

    Raman1667,

    This actually works nicely for me. I'm messing around with some my data to possibly create a dashboard. I don't have any idea what my end product might be that is if I get that far.

    Excel is so powerful and I'm still learning. Thank you for your help.

    Jim

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Cleaning Data

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  11. #11
    Registered User
    Join Date
    09-09-2015
    Location
    India
    MS-Off Ver
    2010
    Posts
    65

    Re: Cleaning Data

    Quote Originally Posted by sorensjp View Post
    Raman1667,

    This actually works nicely for me. I'm messing around with some my data to possibly create a dashboard. I don't have any idea what my end product might be that is if I get that far.

    Excel is so powerful and I'm still learning. Thank you for your help.

    Jim
    Hi Jim,

    If my answer helped, Kindly add reputation by clicking on the small "star" icon located in the lower left corner of the post and mark this thread as SOLVED.

    Thanks & Regards
    Ramandeep Singh
    Please Click * icon to Add Reputation if my answer helped!

+ 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] Data Cleaning
    By cmokasak in forum Excel General
    Replies: 7
    Last Post: 07-08-2016, 03:08 AM
  2. cleaning DATA
    By OSK in forum Excel General
    Replies: 1
    Last Post: 10-30-2014, 09:51 AM
  3. Data cleaning
    By platesigns in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-13-2014, 12:59 PM
  4. Help cleaning up data
    By Impartial Derivative in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-12-2011, 01:26 PM
  5. Cleaning data
    By cool.chatbot in forum Excel General
    Replies: 11
    Last Post: 02-09-2011, 03:31 AM
  6. Data cleaning, HELP!
    By a303 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-06-2007, 01:43 AM
  7. Data Cleaning
    By mazmjh in forum Excel General
    Replies: 1
    Last Post: 11-27-2006, 12:12 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