+ Reply to Thread
Results 1 to 8 of 8

Formula to identify if a dataset contains gaps

  1. #1
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Formula to identify if a dataset contains gaps

    Morning all,

    My first post of 2021 so best wishes to all.

    I'm pulling together a template and I'd like to ensure that the data is input as one dataset, i.e. doesn't include any gaps. I currently have an error check built in that ensures all cells in a row are populated. How can I check that all rows are populated in order? NB - Not all rows in the template may be required/expected to contain data, i.e. gaps at the bottom are permitted.

    Attached is an example of the data I'm working with.

    Any queries, just shout.

    Thanks in advance,

    Snook

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,853

    Re: Formula to identify if a dataset contains gaps

    I think you are overcomplicating it. Try this:

    =IF(COUNTBLANK(H5:J5)>0,"Error - All cells must be completed","OK")
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Formula to identify if a dataset contains gaps

    In K5, copied down:

    =IF(COUNTA(H5:$H$24)=0,"",IF(H5<>"","OK","Error"))
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,853

    Re: Formula to identify if a dataset contains gaps

    Or this:

    =IF(ROW()>LOOKUP(2,1/($H$5:$H$24<>""),ROW($H$5:$H$24)),"",IF(COUNTBLANK(H5:J5)>0,"Error - All cells must be completed","OK"))

    @Glenn

    Not sure about yours:

    Excel 2016 (Windows) 32 bit
    H
    I
    J
    K
    L
    4
    Bidder Name
    Bid 1
    Bid 2
    AliGW
    Glenn
    5
    Bidder 1
    £ 922.00
    £ 737.00
    OK
    OK
    6
    Bidder 2
    £ 672.00
    £ 306.00
    OK
    OK
    7
    Bidder 3
    £ 865.00
    £ 405.00
    OK
    OK
    8
    Bidder 4
    £ 801.00
    £ 547.00
    OK
    OK
    9
    Bidder 5
    £ 225.00
    Error - All cells must be completed
    OK
    10
    Bidder 6
    £ 566.00
    £ 115.00
    OK
    OK
    11
    Bidder 7
    £ 957.00
    £ 557.00
    OK
    OK
    12
    Bidder 8
    £ 652.00
    £ 456.00
    OK
    OK
    13
    Bidder 9
    £ 615.00
    £ 588.00
    OK
    OK
    14
    Bidder 10
    £ 944.00
    £ 778.00
    OK
    OK
    15
    Bidder 11
    £ 972.00
    £ 549.00
    OK
    OK
    16
    Bidder 12
    £ 370.00
    £ 353.00
    OK
    OK
    17
    Error - All cells must be completed
    Error
    18
    Bidder 14
    £ 235.00
    £ 361.00
    OK
    OK
    19
    Bidder 15
    £ 163.00
    £ 154.00
    OK
    OK
    20
    Bidder 16
    £ 391.00
    £ 290.00
    OK
    OK
    21
    Bidder 17
    £ 305.00
    £ 445.00
    OK
    OK
    22
    23
    24
    Sheet: Sheet1
    Last edited by AliGW; 01-19-2021 at 07:10 AM.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Formula to identify if a dataset contains gaps

    Or, you could allow data to be entered into a Raw_data sheet like that shown in your Bad example, and then get rid of the blanks yourself in another sheet, which is the one that drives your template, so the User is none the wiser.

    Hope this helps.

    Pete

  6. #6
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Re: Formula to identify if a dataset contains gaps

    Thanks all, much appreciated as always.

    Ali your 2nd solution worked a treat, thanks.

    @Glenn - Close but no cigar.
    @Pete - Time permitting I'd have made it more foolproof/robust but as is usually the case this needs turning round and firing out the door asap.

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Formula to identify if a dataset contains gaps

    Another one

    K5
    =IF(COUNTA(H5:J$24),IF(COUNTA(H5:J5)=3,"OK","Error - All cells must be completed"),"")

  8. #8
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Re: Formula to identify if a dataset contains gaps

    Interesting solution, I like it.

    Cheers Bo_Ry

+ 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. Have date ranges. Given a bigger date range, I need to identify gaps.
    By James Keuning in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-11-2019, 05:22 PM
  2. Compare date range to list of ranges and identify gaps
    By James Keuning in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-13-2019, 12:05 AM
  3. Replies: 1
    Last Post: 09-02-2018, 11:45 PM
  4. Replies: 3
    Last Post: 10-20-2017, 12:40 AM
  5. [SOLVED] Identify gaps in dates within a range
    By leslieharris in forum Excel General
    Replies: 5
    Last Post: 08-12-2012, 02:01 AM
  6. [SOLVED] Identify max and mins in dataset automatically
    By ozsunny2 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-04-2012, 06:14 AM
  7. Copying a dataset multiple times - and selecting titles for this dataset
    By alocke in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-07-2012, 10:15 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