+ Reply to Thread
Results 1 to 3 of 3

countif (2 row comparisons)

  1. #1
    Registered User
    Join Date
    01-13-2009
    Location
    IA
    MS-Off Ver
    Excel 2003 SP2
    Posts
    2

    countif (2 row comparisons)

    Hi everyone, I've got a situation I've been trying to figure out for a while and I absolutely can't. What I need to do is do a countif to look at 2 different rows and if they are the correct value, to add 1 to the countif.

    To demonstrate:
    1 Yes
    1 No
    5 Yes
    3 Yes
    1 Yes
    5 No

    In this example, I want to be able to count if 1 and Yes are on the same line (in this case it would be 2). I have a semi working formula at the moment but it is rather ugly, it involves creating a new column that concatenates the 2 rows together, then comparing one line (COUNTIF(X:X,1Yes)). If there is anyone way to do this I would really appreciate anyones input. Thanks in advance!

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Use SumProduct() instead...

    e.g. =Sumproduct((A1:A100=1)*(B1:B100="Yes"))

    Note: You cannot use whole column References like X:X in Excel 2003 with this formula.
    Where there is a will there are many ways.

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

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

  3. #3
    Registered User
    Join Date
    01-13-2009
    Location
    IA
    MS-Off Ver
    Excel 2003 SP2
    Posts
    2
    Holy crap, on my test scenario it just worked, I'm going to try putting it into production, 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.6.0 RC 1