+ Reply to Thread
Results 1 to 3 of 3

Count the number of blank cells in a range, but only if the cell to the left is not blank

  1. #1
    Registered User
    Join Date
    11-22-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2013
    Posts
    1

    Count the number of blank cells in a range, but only if the cell to the left is not blank

    Hi all ... First post for me, and apologies if this has been solved elsewhere here. I have looked, but don't seem to find a solution, thus my post ...

    I have two columns, the first for "Serial Number" and the second for "Device Warranty", as per the attached image.

    As I would like my spreadsheet to be future proof, and thus allow as many entries as time will add to it, I would like to count the number of blank cells in the "Device Warranty" column, but only count it if the cell to its left, "Serial Number" is not blank.

    In other words, I would like to know how many devices I have without a warranty.

    I have searched and trawled forums, bashed my head (still have the bruise) and I just can't seem to get this right ...

    Any help?

    Thanks!

    Adam

    excel.GIF

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

    Re: Count the number of blank cells in a range, but only if the cell to the left is not b

    Hi

    perhaps =SUMPRODUCT(--(B1:B100=""),--(A1:A100<>""))

  3. #3
    Registered User
    Join Date
    11-20-2013
    Location
    Las Vegas, NV
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Count the number of blank cells in a range, but only if the cell to the left is not b

    This may not be the prettiest, but I got it to work.
    You create a column off the page that you will eventually hide / not be in the printable zone.
    If Column A = Serial Number and Column B = Device Warranty

    You do formulas for each row (example of code for Row 2): =IF(AND(A2<>0,B2=0),1,0)

    So, it should give you a "1" if it meets the criteria you listed. Then just make a cell somewhere that says (If that column happened to be column C): =SUM(C:C)

+ 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. [SOLVED] Trim Range of Cells FIRST then Count the number of blank cells
    By Jim28 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-13-2013, 04:08 AM
  2. Count 52 Cells Starting From First Non Blank Cell In Range
    By Caedmonball19 in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 08-20-2013, 12:23 PM
  3. Count number of non-blank cells in a range
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-15-2011, 10:15 PM
  4. if blank cells, paint yellow. if cell to left is less than a number, don't paint
    By curbster in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-09-2009, 02:40 AM
  5. Count blank cells within a range not including fully blank rows
    By twofootgiant in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 07-16-2008, 09:43 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