+ Reply to Thread
Results 1 to 6 of 6

clearing empty cells in export files

  1. #1
    Registered User
    Join Date
    02-05-2019
    Location
    Seattle, WA
    MS-Off Ver
    Home and Business 2016
    Posts
    3

    clearing empty cells in export files

    Hi wondering if anyone else has noticed this problem? I do a lot of csv and xls exports, and lately empty cells are not actually empty.

    For example, I export all of my bank transactions for January. There are columns for Debits and Credits. No row will have data in both of those fields.

    If I try to write a formula the result always comes back as an error.
    I found that going to each empty cell and pressing the delete key fixes the problem.

    But that's really not a practical solution - is there a setting in the latest version of Excel that creates this issue? I've been exporting and working in Excel since the late 90s, and this is a relatively new thing.

    Thanks!

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: clearing empty cells in export files

    So you export to csv from Excel? Or is it export from 3rd party software?

    If the latter, just use PowerQuery to import data into Excel. In PQ editor, you can set up steps to remove unwanted columns or automatically replace blank strings with null value (i.e. true blank).

    If you need further help, I'd recommend uploading sample workbook/csv along with desired out put you are after.

    To upload file, use "Go Advanced" button and follow "Manage Attachments" hyperlink. It will launch new tab/window for managing file uploads.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    02-05-2019
    Location
    Seattle, WA
    MS-Off Ver
    Home and Business 2016
    Posts
    3

    Re: clearing empty cells in export files

    I'm exporting data from a website into Excel. This comes up whether I do it as a csv or xls.

    I've uploaded the workbook that exported today's data. The first section is as exported, came back with an error when I tried to calculate a number.
    The second section is after pressing Delete in the empty cells, and the formula works correctly.

    My question is, why do I have to select the empty cells and Delete? What changed since the earlier Excel?
    Most importantly - How do I stop this from happening? Going through a month's worth of data and pressing the Delete key is not a practical solution.
    Attached Files Attached Files

  4. #4
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,472

    Re: clearing empty cells in export files

    Ya this is a legit problem that i don't have a fix for. What i do have is a simple quality of life fix potentially.
    1. Select Columns D and E
    2. Change format to Number
    3. With columns D and E selected select "Go to Special" on the home ribbon.
    4. check the "Constants" box and uncheck Numbers Logicals and Errors. (So only Text will be selected and Constants.) Hit ok
    5. Hit the Delete button on your keyboard.

    This will fix all the effected cells and make your formulas work. Make sure to retype your column D and E headers "Debit and Credit"

  5. #5
    Registered User
    Join Date
    02-05-2019
    Location
    Seattle, WA
    MS-Off Ver
    Home and Business 2016
    Posts
    3

    Re: clearing empty cells in export files

    Thank you! That will save me so many keystrokes

    Why does MS have to make things so convoluted ...?

  6. #6
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: clearing empty cells in export files

    Issue is due to how website/3rd party program exports to Excel/CSV file.

    1. Excel is based on Office Open XML, it could be that site/program is using older SDK instead of 2.9
    2. For csv many site/program use standard Double Quote + comma for each field. This means blank field will have "",. When it's read by Excel, unless Text Qualifier is specifically chosen, will be treated much like formula generated blank (i.e. blank string). Which is different from blank cell.
    3. Occasionally, you'll find some programs that export out xls file. But it's really HTML file masquerading as Excel file. These file will often contain non-printing character which need to be removed.

    If you import range to PQ, you will notice blank cells showing blank. This means that these are blank string and not actual blank (i.e. null).
    0.JPG

    In PQ editor, select all columns and replace blank with null like image below.
    1.JPG

    Then change column data type as needed and return to Excel (or add calculations in PQ).
    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. Clearing Blank (but not Empty) cells
    By jon687 in forum Excel General
    Replies: 5
    Last Post: 01-04-2018, 12:09 PM
  2. [SOLVED] Export Data in Rows, Separated by Empty Cells to Text Files
    By leoxanigm in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-16-2014, 09:53 AM
  3. export specific cells to several text files
    By BSJ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-01-2013, 04:20 AM
  4. [SOLVED] While writing files from another workbook, keep empty cells empty!
    By nivoe in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-09-2012, 12:25 PM
  5. Export Excel into csv: Why headers and empty cells!?!
    By FlipFlops in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-24-2011, 12:56 PM
  6. Customized macro to export cells to txt files?
    By Handyy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-23-2010, 09:27 AM
  7. ExcelDiet and clearing empty cells
    By drgogo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-13-2010, 05:25 AM

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