+ Reply to Thread
Results 1 to 7 of 7

Thread: Countif filled cells in multiple columns

  1. #1
    Registered User
    Join Date
    08-11-2010
    Location
    Stockholm
    MS-Off Ver
    Excel 2010
    Posts
    31

    Countif filled cells in multiple columns

    Hi,

    I have to count how many rows are filled with data in 3 columns. All the columns can be filled, or just one.. I was thinking on something like countif(OR(column 1, column 2, column 3, "*").

    Unfortunately it doesn't appear to be possible to add such thing. Any way around it? SUMPRODUCT?

    Vasco
    Last edited by vascobmcastro; 09-07-2010 at 02:32 PM.

  2. #2
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Countif filled cells in multiple columns

    Try:

    =COUNTIFS(A1:A5,"<>",B1:B5,"<>",C1:C5,"<>")

    adjusting ranges to suit..
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    08-11-2010
    Location
    Stockholm
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Countif filled cells in multiple columns

    Unfortunately this will only count rows where all the 3 columns have been filled. Maybe my explanation wasn't so good before. What I would like to have is an expression that will count rows that contain at least one cell that is filled in those 3 columns.

  4. #4
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2007
    Posts
    10,056

    Re: Countif filled cells in multiple columns

    Try

    =SUMPRODUCT((LEN(A1:A100&B1:B100&C1:C100)>0)+0)
    Audere est facere

  5. #5
    Registered User
    Join Date
    08-11-2010
    Location
    Stockholm
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Countif filled cells in multiple columns

    Exactly!!!!! Thanks!

    2 more things:
    - Why the +0 inside sumproduct?
    - How do I adapt this formula so only rows that on the 4th column have the country "Austria" would be counted?

    vasco

  6. #6
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Countif filled cells in multiple columns

    I guess I did misinterpret... I thought you said all 3 columns must be filled..

    Try:

    =SUMPRODUCT((LEN(A1:A100&B1:B100&C1:C100)>0)+0,(D1:D100="Austria")+0)

    the +0 coerces the array of resulting TRUEs and FALSEs to 1's and 0's respectively, so Sumproduct can do its math.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  7. #7
    Registered User
    Join Date
    08-11-2010
    Location
    Stockholm
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Countif filled cells in multiple columns

    Thanks!

+ 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.2.0