+ Reply to Thread
Results 1 to 5 of 5

Too long countifs statement

  1. #1
    Registered User
    Join Date
    11-24-2009
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    16

    Too long countifs statement

    Hello all,

    I have a problem with my countifs statement in that it is too long. All that I want to do is count how many rows do not have an NA value. The problem is that I want to do this with multiple columns. Attached is a sample of what I am talking about with my countifs statement. I think a sumproduct formula would work here, but I can't seem to figure it out. Any help would be greatly appreciated. Thanks.
    Attached Files Attached Files

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Too long countifs statement

    Hi,

    How many rows do not have a "NA" value is 4, right? For that use

    =SUMPRODUCT(--(B4:B10<>"NA"),--(C4:C10<>"NA"),--(D4:D10<>"NA"))

    Is that what you need?

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Too long countifs statement

    Is this just an example - how many columns do you need to check?

  4. #4
    Registered User
    Join Date
    11-24-2009
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Too long countifs statement

    Thanks for the reply. There are 20 columns with about 14,000 rows of data. I am trying figure out which rows are labeled "Test" but have a value for each column (thus if they have an "NA" anywhere in that row, I do not want to count this row). Also, there could be other non numeric values in the row and if that is the case, I would like to throw out these rows and not include it in my count.

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Too long countifs statement

    OK so say you have column A which says "Test" or not and columns B to U which have numbers/"N/A" or other text, and you want to count only those rows which have "test" in column A and 20 numbers in B to U.

    Simplest way might be to use an extra column, i.e. in V2 copied down

    =(A2="Test")*(COUNT(B2:U2)=20)

    Now just sum that column, i.e.

    =SUM(V2:V14000)

    alternatively, without a helper column try

    =SUMPRODUCT((SUBTOTAL(2,OFFSET(B2:U2,ROW(B2:U14000)-ROW(B2),0))=COLUMNS(B2:U2))*(A2:A14000="test"))

+ 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