+ Reply to Thread
Results 1 to 3 of 3

COUNTIF based on condition from 2 columns

  1. #1
    Registered User
    Join Date
    09-25-2009
    Location
    Romania
    MS-Off Ver
    Excel 2003
    Posts
    51

    COUNTIF based on condition from 2 columns

    Hello,

    I have the following situation:

    I need to count how many times a key work appears on a column, based on condition from another column...

    Example:
    A B
    q w
    q y
    a w
    z w

    I need to count how many times "w" appears in col B when col A value is "q". (so the result would be 1 to the above example)

    I tryed a COUNTIF:
    =COUNTIF(AND(B1:B4;"=w"; A1:A4="q"))
    but of course the formula is not correct.

    Please advise...
    Last edited by alexandruc; 12-07-2009 at 06:06 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: COUNTIF based on condition from 2 columns

    Try:

    =SUMPRODUCT(--(A1:A1000="g");--(B1:B1000="w"))

  3. #3
    Registered User
    Join Date
    09-25-2009
    Location
    Romania
    MS-Off Ver
    Excel 2003
    Posts
    51

    Re: COUNTIF based on condition from 2 columns

    Thank you very much. It's perfect!

+ 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