+ Reply to Thread
Results 1 to 9 of 9

Cleaning an Excel Sheet

  1. #1
    Registered User
    Join Date
    06-12-2013
    Location
    Canada
    MS-Off Ver
    Excel 2016
    Posts
    35

    Question Cleaning an Excel Sheet

    Hi,

    I am not sure how to use the Text Import Wizard.
    The Header with data starts at row 152 and I would like to remove all the rows above.

    The vertical lines in the wizard does not properly separate the headers. I'm assuming the vertical lines should go to the left of every entry.

    The data gets all messed up at line 228 after deleting the rows above the headers. see attached files.

    I can't upload the file because it's too large but the data can be found here:

    https://www.esrl.noaa.gov/gmd/ccgg/trends/data.html

    click on "Products and Data", then on "Search for data sets". On the menu that appears, select "greenhouse gases", then "carbon dioxide", and under "frequency" select "hourly averages". Then you can pick from four sites for which we have several decades of data. In the table that lists the data you can click on "i" for a documentation file about the data.

    If you can point what what I'm doing wrong that would be great.

    Thanks

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

    Re: Cleaning an Excel Sheet

    Excel 2010:
    Choose Data > Get External Data > From Text and choose your source text file, click Import.
    Choose 'Delimited', start import at row 153, click Next.
    Under 'Delimiters', tick Space, and untick all others. Click Finish.
    Choose where to put the data, and click OK.
    You'll have an additional cell in the 'header' row, containing "# " - simply delete this cell (shift left).


    You could also use Power Query - which will make it easier to refresh the data, and join up data from multiple similar sources. Something like:
    Please Login or Register  to view this content.
    Last edited by Olly; 10-31-2017 at 05:54 AM.
    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...

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

    Re: Cleaning an Excel Sheet

    Here's a couple of power queries which will combine all four text sources, and filter out irrelevant values. It returns around 1.3 million rows - so I'd suggest loading to Power Pivot data model, rather than materialising the data on worksheet(s).

    fnGetTxtData:
    Please Login or Register  to view this content.

    CombinedData:
    Please Login or Register  to view this content.
    Attached file has query as connection only, to keep file size small.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    06-12-2013
    Location
    Canada
    MS-Off Ver
    Excel 2016
    Posts
    35

    Question Re: Cleaning an Excel Sheet

    Quote Originally Posted by Olly View Post
    Excel 2010:
    Choose Data > Get External Data > From Text and choose your source text file, click Import.
    Choose 'Delimited', start import at row 153, click Next.
    Under 'Delimiters', tick Space, and untick all others. Click Finish.
    Choose where to put the data, and click OK.
    You'll have an additional cell in the 'header' row, containing "# " - simply delete this cell (shift left).
    DOes anyone know how to do this in Excel 2016?

    If I use space as a delimiter I only get the code and the year.

    Is there a simpler method of doing this?
    Attached Images Attached Images

  5. #5
    Registered User
    Join Date
    06-12-2013
    Location
    Canada
    MS-Off Ver
    Excel 2016
    Posts
    35

    Re: Cleaning an Excel Sheet

    Quote Originally Posted by Olly View Post
    Attached file has query as connection only, to keep file size small.

    Unfortunately the Excel sheet you provided is blank because it's not establishing a connection.

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Cleaning an Excel Sheet

    .
    I copied 76,000 rows, pasted in A2.

    Went back and copied the HEADERS from the website : site_code year month day hour minute second value value_unc nvalue latitude longitude altitude elevation intake_height instrument qcflag
    Pasted that in A1.

    Highlight all of Col A.

    Then went to the DATA tab / TEXT TO COLUMNS and followed these selections :

    Delimited
    Tab & Space
    Next
    Finish

    I suspect you will need to copy several groups of the data ... perhaps another 70,000 rows at a time ? and repeat the procedure.

    ALSO: There are a total of 385,705 rows of data total.
    Attached Files Attached Files
    Last edited by Logit; 10-31-2017 at 11:34 PM.

  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: Cleaning an Excel Sheet

    Quote Originally Posted by TheRevenant View Post
    Unfortunately the Excel sheet you provided is blank because it's not establishing a connection.
    It's blank, as I have neither materialised the query in a table, not loaded to the data model.

    I'd suggest you choose to load to the data model, then manipulate your data in Power Pivot.

    I offered step by step instructions for Excel 2010 as that's what your profile states you are using...

    Edit:

    Repeating myself, this query works (in 2016) for a single file:
    Please Login or Register  to view this content.
    Last edited by Olly; 11-01-2017 at 05:13 AM.

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

    Re: Cleaning an Excel Sheet

    Here's the workbook with the data (for all four source files) added to the data model, and summarised in a pivot table. It's a 3.5Mb zip file.


    https://excel.solutions/wp-content/u...eRevenant2.zip

    You can update by simply clicking "Data > Refresh All" - no need to undertake any manual import steps.

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

    Re: Cleaning an Excel Sheet

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. 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. Cleaning up excel sheet taking too long
    By slamdunka in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2015, 02:32 AM
  2. Replies: 6
    Last Post: 02-08-2014, 05:01 AM
  3. Cleaning a dirty sheet.
    By rbs123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-13-2014, 04:27 AM
  4. Cleaning Excel cache via VBA
    By Jovica in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-15-2013, 03:47 AM
  5. Cleaning a Sheet to the Original Formulae
    By Alexander_Read in forum Excel General
    Replies: 1
    Last Post: 09-05-2008, 07:19 AM
  6. cleaning excel columns
    By jodenice in forum Excel General
    Replies: 1
    Last Post: 12-28-2007, 10:13 AM
  7. Need help cleaning up an email list in Excel
    By Amie G in forum Excel General
    Replies: 2
    Last Post: 10-06-2005, 08:05 PM

Tags for this Thread

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