+ Reply to Thread
Results 1 to 12 of 12

Count Non-blank Rows

  1. #1
    Registered User
    Join Date
    04-10-2015
    Location
    Jerusalem, Israel
    MS-Off Ver
    Office 2011 for Mac
    Posts
    11

    Count Non-blank Rows

    Again I've Googled hours looking for a solution to this (including searching this forum) :-(

    I have the following table and would like to get the number of rows where EITHER column A OR B is NOT blank (has either text or number).

    column A column B column C
    50 100
    Has Text 100
    90
    50 Has Text 100

    So the result in this case would be 3.

    Thanks for your help!

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Count Non-blank Rows

    why not 4 ?

  3. #3
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Count Non-blank Rows

    Try this array formula
    =SUM(--((--(A1:A4<>"")+(--(B1:B4<>"")))>0))
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Count Non-blank Rows

    Hi,

    Try the following formula:

    =ROWS(A2:A5)-COUNTIFS(A2:A5,"=",B2:B5,"=")

  5. #5
    Valued Forum Contributor
    Join Date
    04-27-2015
    Location
    Abu Dhabi, U.A.E
    MS-Off Ver
    Office 365 | 2016
    Posts
    696

    Re: Count Non-blank Rows

    Try this formula:

    2-COUNTA(A1:B1)
    If the value is showing 1, one of the cells is blank
    If the value is showing 2, both cells are blank
    If the value is showing 0, both cells are not empty

  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: Count Non-blank Rows

    Try this...

    Data Range
    A
    B
    C
    D
    E
    1
    50
    100
    3
    2
    Has Text
    100
    3
    90
    4
    50
    Has Text
    100
    5
    ---------
    ---------
    ---------
    ---------
    ---------


    This formula entered in E1:

    =SUMPRODUCT(SIGN((A1:A5<>"")+(B1:B5<>"")))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Registered User
    Join Date
    04-10-2015
    Location
    Jerusalem, Israel
    MS-Off Ver
    Office 2011 for Mac
    Posts
    11

    Re: Count Non-blank Rows

    Thank you José — that worked nicely.

    I also liked (and wound up using) Tony Valko's option because it doesn't need to be entered as an ARRAY FORMULA.
    Last edited by natkoy; 10-11-2015 at 12:59 PM.

  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: Count Non-blank Rows

    You're welcome. We appreciate the feedback!

    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

  9. #9
    Forum Contributor
    Join Date
    09-18-2015
    Location
    Republic of Korea
    MS-Off Ver
    2010
    Posts
    314

    Re: Count Non-blank Rows

    Hi cbatrody

    if I may ask...

    ??? 3.jpg

  10. #10
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Count Non-blank Rows

    Hi chief,

    COUNTIFS(A2:A5,"=",B2:B5,"=")

    "=" returns count of rows that are blank in column A & column B within the mentioned range (rows 2:5)

  11. #11
    Forum Contributor
    Join Date
    09-18-2015
    Location
    Republic of Korea
    MS-Off Ver
    2010
    Posts
    314

    Re: Count Non-blank Rows

    Thanks for your help!

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

    Re: Count Non-blank Rows

    Quote Originally Posted by cbatrody View Post
    COUNTIFS(A2:A5,"=",B2:B5,"=")

    "=" returns count of rows that are blank in column A & column B within the mentioned range (rows 2:5)
    This will do the same thing:

    COUNTIFS(A2:A5,"",B2:B5,"")

+ 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. VBA : insert blank rows between base upon count of each rows with criteria..need help??
    By Jhon Mustofa in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-10-2013, 12:30 AM
  2. insert blank rows between base on count of rows, help???/
    By Jhon Mustofa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-04-2013, 03:25 AM
  3. Count rows with non-blank cells
    By V272846 in forum Excel General
    Replies: 8
    Last Post: 10-26-2012, 07:18 AM
  4. How can i use UsedRange.Rows.Count if any blank rows embeded into the sheet
    By amarendra19 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-20-2011, 11:52 AM
  5. VBA to count cells between blank rows
    By EggNogMan in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-20-2010, 10:34 AM
  6. 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
  7. Count blank rows between occurrences
    By shoey72 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-19-2008, 09:24 AM
  8. [SOLVED] Count Non-Blank Rows
    By Lazzaroni in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 04-28-2006, 02:25 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