+ Reply to Thread
Results 1 to 9 of 9

Checking for empty cells in a range

Hybrid View

  1. #1
    Chris Strug
    Guest

    Checking for empty cells in a range

    Hi,

    Probably a silly question but I'm not sure of the best way to achieve it.

    Basically, given a range (say A7:A30) what's the best way to see if any of
    these cells are empty / null / blank. I don't necessarily need to know which
    ones simply that there is one or more blank cell present.

    Any advice, links or any other help is gratefully received.

    Thanks

    Chris.




  2. #2
    Roman
    Guest

    Re: Checking for empty cells in a range

    This formula says how many blank cells are there in you range:

    =SUMPRODUCT(--(ISBLANK(A7:A30)))


  3. #3
    Toppers
    Guest

    RE: Checking for empty cells in a range

    Chris,
    Use COUNTBLANK function:

    =COUNTBLANK(a7:A30)

    HTH

    "Chris Strug" wrote:

    > Hi,
    >
    > Probably a silly question but I'm not sure of the best way to achieve it.
    >
    > Basically, given a range (say A7:A30) what's the best way to see if any of
    > these cells are empty / null / blank. I don't necessarily need to know which
    > ones simply that there is one or more blank cell present.
    >
    > Any advice, links or any other help is gratefully received.
    >
    > Thanks
    >
    > Chris.
    >
    >
    >
    >


  4. #4
    Forum Contributor
    Join Date
    05-09-2005
    Location
    SC
    Posts
    196
    Hello,

    Both formulas posted work great. The COUNTBLANK one is the simpliest. However, how do you add other ranges like C7:C30 to the formula with getting the too many arguments message?

    =SUMPRODUCT(--(ISBLANK(A7:A30,C7:C30))) Doesn't work

    =COUNTBLANK(a7:A30,C7:C30) Doesn't Work

    Thanks,
    EMoe

  5. #5
    Norman Jones
    Guest

    Re: Checking for empty cells in a range

    Hi EMoe,

    > =SUMPRODUCT(--(ISBLANK(A7:A30,C7:C30))) Doesn't work


    One way:

    =SUMPRODUCT(--(ISBLANK(A7:A30)--(ISBLANK(C7:C30))))

    ---
    Regards,
    Norman



    "EMoe" <[email protected]> wrote in message
    news:[email protected]...
    >
    > Hello,
    >
    > Both formulas posted work great. The COUNTBLANK one is the simpliest.
    > However, how do you add other ranges like C7:C30 to the formula with
    > getting the too many arguments message?
    >
    > =SUMPRODUCT(--(ISBLANK(A7:A30,C7:C30))) Doesn't work
    >
    > =COUNTBLANK(a7:A30,C7:C30) Doesn't Work
    >
    > Thanks,
    > EMoe
    >
    >
    > --
    > EMoe
    > ------------------------------------------------------------------------
    > EMoe's Profile:
    > http://www.excelforum.com/member.php...o&userid=23183
    > View this thread: http://www.excelforum.com/showthread...hreadid=380477
    >




  6. #6
    Norman Jones
    Guest

    Re: Checking for empty cells in a range

    Hi Toppers,

    A potential problem with the use of the COUNTBLANK worksheet function is
    that cells containining formulas which resolve to "" are treated as blank.

    ---
    Regards,
    Norman



    "Toppers" <[email protected]> wrote in message
    news:[email protected]...
    > Chris,
    > Use COUNTBLANK function:
    >
    > =COUNTBLANK(a7:A30)
    >
    > HTH
    >
    > "Chris Strug" wrote:
    >
    >> Hi,
    >>
    >> Probably a silly question but I'm not sure of the best way to achieve it.
    >>
    >> Basically, given a range (say A7:A30) what's the best way to see if any
    >> of
    >> these cells are empty / null / blank. I don't necessarily need to know
    >> which
    >> ones simply that there is one or more blank cell present.
    >>
    >> Any advice, links or any other help is gratefully received.
    >>
    >> Thanks
    >>
    >> Chris.
    >>
    >>
    >>
    >>




  7. #7
    Dave Peterson
    Guest

    Re: Checking for empty cells in a range

    If the cells are really empty--not formulas that evaluate to "":

    dim myRng as range
    set myrng = worksheets("sheet1").range("a7:A30")

    if myrng.cells.count > application.counta(myrng) then
    'at least one empty
    else
    'all filled
    end if

    And if you want to include those formulas that evaluate to ""
    (using Topper's suggestion)

    dim myRng as range
    set myrng = worksheets("sheet1").range("a7:A30")

    if application.countblank(myrng) > 0 then
    'at least one empty
    else
    'all filled
    end if


    Chris Strug wrote:
    >
    > Hi,
    >
    > Probably a silly question but I'm not sure of the best way to achieve it.
    >
    > Basically, given a range (say A7:A30) what's the best way to see if any of
    > these cells are empty / null / blank. I don't necessarily need to know which
    > ones simply that there is one or more blank cell present.
    >
    > Any advice, links or any other help is gratefully received.
    >
    > Thanks
    >
    > Chris.


    --

    Dave Peterson

  8. #8
    Forum Contributor
    Join Date
    11-09-2004
    Posts
    451
    =sumproduct(--(isblank(b7:b30))+--(isblank(c7:c30)))

  9. #9
    Dave Peterson
    Guest

    Re: Checking for empty cells in a range

    Or just:

    =SUMPRODUCT(--(ISBLANK(B7:C30)))

    But I would think that the OP wanted a programming solution--since Chris posted
    in .programming.

    anilsolipuram wrote:
    >
    > =sumproduct(--(isblank(b7:b30))+--(isblank(c7:c30)))
    >
    > --
    > anilsolipuram
    > ------------------------------------------------------------------------
    > anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
    > View this thread: http://www.excelforum.com/showthread...hreadid=380477


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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