+ Reply to Thread
Results 1 to 5 of 5

Count unequal cells with condition IF

  1. #1
    Registered User
    Join Date
    04-23-2010
    Location
    tripoli
    MS-Off Ver
    Excel 2010
    Posts
    11

    Question Count unequal cells with condition IF

    Hello:

    I need formula like COUNTIF or COUNTIFS, but just for unequel cells, i.e count cells without count repeated cells.
    if :
    A1=3 B1=Joe
    A2=5 B2=terry
    A3=3 B3=Joe
    A4=9 B4=Joe
    A5=0 B5=terry

    then the count of Joe should be =2 not 3.


    Please check attachment worksheet.


    Thanks
    Attached Files Attached Files
    Last edited by troy_yy; 04-26-2010 at 07:29 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Count unequal cells with condition IF

    Please use an appropriate font in your posts.

    One approach:

    B2:
    =SUMPRODUCT(--($B$9:$B$72=$A2);--(MATCH($A$9:$A$72&"@"&$B$9:$B$72;$A$9:$A$72&"@"&$B$9:$B$72;0)=(ROW($A$9:$A$72)-ROW($A$9)+1)))
    copied down

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Count unequal cells with condition IF

    On a final note - if (as it seems) the Site Name has a relationship of 1:1 with Region (ie a site name can never appear in more than one region) you could simplify to:

    =SUMPRODUCT(($B$9:$B$72=$A2)/COUNTIF($A$9:$A$72;$A$9:$A$72&""))

    the MATCH approach is only really required where the relationship is not 1:1 - ie a Site could appear in multiple regions.

  4. #4
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500

    Re: Count unequal cells with condition IF

    =SUMPRODUCT(($B$9:$B$72=A2)*($A$9:$A$72<>"")/COUNTIF($A$9:$A$72,$A$9:$A$72&""))

    would also work, but in cell a3 you have added a space after the surt, so the match will fail unless you delete it

    Regards

    Dav

  5. #5
    Registered User
    Join Date
    04-23-2010
    Location
    tripoli
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Count unequal cells with condition IF

    Thanks A lot, the final note helped me.

    Thank you

+ 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