+ Reply to Thread
Results 1 to 11 of 11

Formula (not vba) to delete row if cell blank on imported data

  1. #1
    Registered User
    Join Date
    04-14-2013
    Location
    Arizona, USA
    MS-Off Ver
    Excel 2003
    Posts
    12

    Formula (not vba) to delete row if cell blank on imported data

    Hello Excel Experts ... I have reviewed the Forum for an answer to this puzzle but I've found nothing. I would appreciate your thoughts/ideas. Thank you!

    I have a database that exports data into an Excel file. I place the data into sheet 2. In sheet 1, I then manipulate the data found in sheet 2 to give me the exact form I'm looking for before importing it into yet another database.

    I am trying to find a formulaic way to delete a row that does not have a value in a certain column. So if 30 rows are imported, and cells D7 and D19 are empty, I would like to delete the row altogether through a formula (not vba).

    Can you help? Thank you!

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula (not vba) to delete row if cell blank on imported data

    A formula can not delete a row.

    Formulas can only return a result to the cell in which the formula is entered.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    04-14-2013
    Location
    Arizona, USA
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Formula (not vba) to delete row if cell blank on imported data

    Ouch! Okay, thank you! (I guess that's why I could not find it???)

    This forum is awesome!

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Formula (not vba) to delete row if cell blank on imported data

    You could use Autofilter to filter on column D for blank cells and then delete the visible rows.

    Not a formula but not VBA either.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Registered User
    Join Date
    04-14-2013
    Location
    Arizona, USA
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Formula (not vba) to delete row if cell blank on imported data

    Thank you for your reply. Although that will work, I am looking for an automated approach because I don't want my users to be 'fussing' with the file. I would just like to have them read the finished product after the formuli do their work. Thanks!

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula (not vba) to delete row if cell blank on imported data

    Without VBA or filtering you don't have too many other options! You could delete the rows manually.

    How many columns of data are there?

    If there aren't too many rows/columns of data you could use formulas to extract all the data to a new range and exclude any rows if column D of that row is empty/blank.

  7. #7
    Registered User
    Join Date
    04-14-2013
    Location
    Arizona, USA
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Formula (not vba) to delete row if cell blank on imported data

    There are 72 columns and no more than 50 rows. I think I see what you are saying. In essence, if D7 is blank I can then blank all fields in that row which will appear like an empty row in between other rows. Hey, that could work for me because I don't have a problem with the row being there if it's all blank. Not perfect but pretty darn close. Thanks!

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula (not vba) to delete row if cell blank on imported data

    Well, not quite like that but if all you want to do is make the other data in the row "disappear" you could hide it using conditional formatting. The trick is to make the font color the same as the fill color having the net effect of making the cells look empty. The data will still be in the cells, you just won't see it unless you select one of the cells in question and then you'll see the cell contents in the formula bar.

    Is that something you would be interested in?

  9. #9
    Registered User
    Join Date
    04-14-2013
    Location
    Arizona, USA
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Formula (not vba) to delete row if cell blank on imported data

    Unfortunately, no. The end result is the file will be imported into a database that will 'see' the data in the field. I will need to actually make the fields blank (e.g., ""). With 72 columns it's a bit onerus but if it will work it's probably less time then looking for other solutions. Thanks, again for your persistence.

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula (not vba) to delete row if cell blank on imported data

    I hate to leave you hangin' but I'm getting ready to call it a day.

    I'll get back to you tomorrow unless someone else jumps in before then and comes up with a solution.

  11. #11
    Registered User
    Join Date
    02-22-2013
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Formula (not vba) to delete row if cell blank on imported data

    I know it is marked solved and may be too late, but if you just want to delete the row without shifting up,

    For cell A1
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If you actually want to shift it up, I started out with this but need more information; do you want the original data of a cell one row below if D is empty, or the data after the row is shifted. in the other word, if D1 is empty and D2 is "ABC", D3 is "CDE", do you want D1 to show "ABC" then D2 to show "CDE", or D1 to show "ABC", D2 to still show "ABC". In vba, I am more than sure it is the first option, but i wasn't sure what you are trying to accomplish using formula so I had to ask...

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If you are to show data of actually shifting up, then the beginning of the formula has to include COUNTBLANK for Column D till that row, and if 0, use above formula, if 1, then shift the above formula to refer one beneath, and so on.

    Jake

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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