+ Reply to Thread
Results 1 to 10 of 10

Remove or hide two null/empty fields in a row

  1. #1
    Registered User
    Join Date
    03-04-2016
    Location
    Holland,MI
    MS-Off Ver
    Excel 2010
    Posts
    5

    Remove or hide two null/empty fields in a row

    I exported data from another reporting tool and I'm trying to figure out how to create a formula to remove two empty 'daysinbetween' fields. The good data will have an empty cell then a number consecutively. The bad data will have two fields with a null value and Im trying to either to remove or hide. I have attached a gif and word doc to show examples of the good data I'd like to keep, and the bad data, Im trying to remove. Any suggestions would be helpful.

    Thanks!
    M
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by m5russell6; 03-04-2016 at 11:35 AM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Remove or hide two null/empty fields in a row

    You'll need VBA I think.
    Perhaps post a real sheet so we can work with it?

  3. #3
    Registered User
    Join Date
    03-04-2016
    Location
    Holland,MI
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Remove or hide two null/empty fields in a row

    Sample attached

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,561

    Re: Remove or hide two null/empty fields in a row

    May not be the most elegant of solutions but you could populate E4 and down with the following formula:
    Please Login or Register  to view this content.
    Then filter based on column E and uncheck Hide.
    Let me know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Registered User
    Join Date
    03-04-2016
    Location
    Holland,MI
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Remove or hide two null/empty fields in a row

    hey it did works! thanks, how do I apply that for two blank fields in a row. I'd like to keep the examples where there is a blank days inbetween and then a number (my original formula is working correctly) and remove the the examples where it has two empty daysbetweenvisit cells in a row(my formula not working as designed).
    thanks

    m

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,561

    Re: Remove or hide two null/empty fields in a row

    If I understand this correctly, your saying that instead of a zero D9 is blank. If that is correct then the following formula will gives the same "Hide" and "Show" results:
    Please Login or Register  to view this content.
    Let me know if you have any questions.

  7. #7
    Registered User
    Join Date
    03-04-2016
    Location
    Holland,MI
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Remove or hide two null/empty fields in a row

    I think its working as designed but Im not sure, can you take a look? All the instances showing are good data except the second to last, B17. The daysbetween for those two visits are both blank, which is what Im trying to remove. See attachment please.

    Thanks

    Matt

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,561

    Re: Remove or hide two null/empty fields in a row

    The reason that the formula was not working was that the number of rows between the blue highlighted rows changed from 3 to 4. this modification to the formula, which can be pasted in E5 and double clicked down, will account for that:
    Please Login or Register  to view this content.
    However, if the pattern of row numbers between the blue highlighted rows is not constant, as seems to be the case in last instance, then we'll need to look at a different formula.
    Let me know if you have any questions.

  9. #9
    Registered User
    Join Date
    03-04-2016
    Location
    Holland,MI
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Remove or hide two null/empty fields in a row

    That formula works great but as you pointed out the number of rows vary. Attached is a more realistic sample. Patients can have a number of visits causing the rows to increase or decrease. Darn, its always something!
    Attached Files Attached Files

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,561

    Re: Remove or hide two null/empty fields in a row

    Here is another way to get "Hide" and "Show" in column E that doesn't depend on a Mod of the row number. It does incorporate some helper columns, which could be hidden for aesthetic reasons. If the row is an "Order date & time" row then column F gives the row number, column G gives the next "Order date &time" row number. G3 gives the maximum number of rows to look between "Order date & time" rows, so it can easily be changed if needed. The formulas for columns E, F and G respectively are:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Here is a copy of the file from post #9 with the formulas applied: Copy of June-July sample data.xls
    Let me know if you have any questions.

+ 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. Hide data labels on the x-axis that represent value of 0 (i.e. remove empty space)
    By lionlunatication in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-24-2013, 10:58 AM
  2. If null be empty
    By hawkins in forum Excel General
    Replies: 1
    Last Post: 06-22-2012, 12:48 PM
  3. [SOLVED] How to sum two fields w/possability of null values & using iif function?
    By jgomez in forum Access Tables & Databases
    Replies: 6
    Last Post: 05-07-2012, 05:25 PM
  4. Replies: 1
    Last Post: 04-25-2011, 01:17 PM
  5. How to hide '0' shown in empty fields (Access form)
    By WillysK5 in forum Access Programming / VBA / Macros
    Replies: 5
    Last Post: 05-22-2009, 10:16 AM
  6. Creating Null fields in Access
    By NBVC in forum Access Tables & Databases
    Replies: 8
    Last Post: 01-13-2009, 11:59 AM
  7. Merging Vertical fields up if fields to either side are empty
    By SuperMykEl in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-09-2008, 11:25 AM

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