+ Reply to Thread
Results 1 to 3 of 3

count without repeting with condition

  1. #1
    Forum Contributor
    Join Date
    01-25-2012
    Location
    Cambodia
    MS-Off Ver
    Excel 2010
    Posts
    135

    count without repeting with condition

    Hi Everyone,

    Previously, I got my thread solved on "Count without repeting".
    =sumproduct((AA<>"")/countif(AA,AA&"")

    But now I cannot figure out when it comes to a condition. For example,
    I want to count the name of item in col A (without repeting) when the QTY in Col B is 2.

    Please see the attached example for clearer view.

    Regards,
    Sarin
    Attached Files Attached Files

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: count without repeting with condition

    Try this array formula**:

    =SUM(IF(FREQUENCY(IF(B2:B16=2,MATCH(A2:A16,A2:A16,0)),ROW(A2:A16)-ROW(A2)+1),1))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: count without repeting with condition

    hi Sarin, try this array formula:
    =SUM(SIGN(FREQUENCY(IF(B2:B16=2,MATCH(A2:A16,A2:A16,0)),ROW(A2:A16)-ROW(A2)+1)))

    ...confirmed by pressing CTRL-SHIFT-ENTER to activate the array. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL-SHIFT-ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

+ 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