+ Reply to Thread
Results 1 to 16 of 16

Help! Count not duplicates

  1. #1
    Registered User
    Join Date
    07-22-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    20

    Help! Count not duplicates

    Hi,

    Good Day!
    I have a list of TASK ID with some values that occur couple of times and I want to count those values as 1.

    Here's a list For Example on Column A:
    TASKID
    CRITERIA1TYPE1
    BREAK
    CRITERIA1TYPE1
    CRITERIA2TYPE1
    CRITERIA3TYPE1
    CRITERIA4TYPE1
    LUNCH
    CRITERIA4TYPE1
    CRITERIA1TYPE2
    CRITERIA1TYPE3
    CRITERIA1TYPE3

    I want to count all CRITERIA1 on column A but not the duplicates.
    If I have to do it manually the total count of CRITERIA1 would be 3.

    I hope that you could help me with this. I've attached a sheet so you could help me with the formula.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Help! Count not duplicates

    I can get you there with 1 helper column

    Helper Column: Starting in C2
    =IF(COUNTIF(A$2:A2,A2)>1,0,1) This will give us a list of 1's and 0's to help with the count. You will need to author this and copy it down the list.


    Count Formula: Put this in H2 -- This is an array formula, you must press cntrl shift and Enter altogether to properly enter it. Excel will add curly braces when you do it right. {} Author this in Cell H2 then drag it down as needed.



    =SUM(IF(LEFT($A:$A,LEN($F2))=$F2,$C:$C,0))

    See attached:
    Attached Files Attached Files
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    07-22-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Help! Count not duplicates

    Quote Originally Posted by GeneralDisarray View Post
    I can get you there with 1 helper column

    Helper Column: Starting in C2
    =IF(COUNTIF(A$2:A2,A2)>1,0,1) This will give us a list of 1's and 0's to help with the count. You will need to author this and copy it down the list.


    Count Formula: Put this in H2 -- This is an array formula, you must press cntrl shift and Enter altogether to properly enter it. Excel will add curly braces when you do it right. {} Author this in Cell H2 then drag it down as needed.



    =SUM(IF(LEFT($A:$A,LEN($F2))=$F2,$C:$C,0))

    See attached:
    Hi,

    I've checked your formula and it's great!
    Is there a way that I could get the the count without the helper column?

    Thanks a lot!

  4. #4
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Help! Count not duplicates

    Not that I can see, but probably... that's a challenging question

    Personally,I would just use the helper column.

  5. #5
    Registered User
    Join Date
    07-22-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Help! Count not duplicates

    Quote Originally Posted by GeneralDisarray View Post
    Not that I can see, but probably... that's a challenging question

    Personally,I would just use the helper column.
    Thank you very much for the big help!

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Help! Count not duplicates

    Quote Originally Posted by GeneralDisarray View Post
    Not that I can see, but probably... that's a challenging question

    Personally,I would just use the helper column.
    I believe so. Try this array-entered formula in H2 and fill down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you aren’t familiar with array-entered formulas array enter means the formula must be committed by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.

    File is attached.
    Attached Files Attached Files
    Dave

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Help! Count not duplicates

    A slightly shorter and less resource heavy version of the above. (Removed a nested IFERROR).
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Also array-entered.

  8. #8
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Help! Count not duplicates

    LOL... See... told you it could be done.


    Had to screw with that for 15 mins to figure it out Very nice.

  9. #9
    Registered User
    Join Date
    07-22-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Help! Count not duplicates

    Quote Originally Posted by FlameRetired View Post
    A slightly shorter and less resource heavy version of the above. (Removed a nested IFERROR).
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Also array-entered.
    This is absolutely Awesome!!!
    Made my day go like crazy.. Thank you so much Guys for the help!
    How I wish my excel skills could be like yours one day... HAHA! :P

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Help! Count not duplicates

    Quote Originally Posted by GeneralDisarray View Post
    LOL... See... told you it could be done.


    Had to screw with that for 15 mins to figure it out Very nice.
    Thank you. It took me longer to 'dumb' it out. LOL

  11. #11
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Help! Count not duplicates

    Quote Originally Posted by shredraldz View Post
    .......Made my day go like crazy.. Thank you so much Guys for the help!
    ...... :P
    You are welcome. Thanks for the feedback and rep.

  12. #12
    Forum Contributor
    Join Date
    12-13-2013
    Location
    Calgary,AB,Canada
    MS-Off Ver
    2016,O365
    Posts
    236

    Re: Help! Count not duplicates

    here is another option by using sumproduct

    1. Assume your source data is in A1:A11
    2. Condition "CRITERIA1" is in C1 ( I am little bit lazy.....), and you will have the control to condition and don't need to revise formula.
    3. E1 =SUMPRODUCT((MATCH(A1:A11,A1:A11,)=ROW(A1:A11))*(LEFT(A1:A11,LEN(C1))=C1)*1)

  13. #13
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Help! Count not duplicates

    Quote Originally Posted by CAABYYC View Post
    here is another option by using sumproduct

    =SUMPRODUCT((MATCH(A1:A11,A1:A11,)=ROW(A1:A11))*(LEFT(A1:A11,LEN(C1))=C1)*1)
    Very nice.

    If I may suggest one small modification.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    The appended "" in the MATCH keep your formula from breaking in the event there are blank cells in the search range.

    Thanks for sharing.

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

    Re: Help! Count not duplicates

    Here's another one.

    This array formula** entered in H2 and copied down:

    =SUM(IF(FREQUENCY(IF(LEFT(A$2:A$12,LEN(F2))=F2,MATCH(A$2:A$12,A$2:A$12,0)),ROW(A$2:A$12)-ROW(A$2)+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.

    The SUM(IF(FREQUENCY array formula is more efficient (faster to calculate) especially on large data sets.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  15. #15
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Help! Count not duplicates

    Quote Originally Posted by Tony Valko View Post
    Here's another one.

    =SUM(IF(FREQUENCY(IF(LEFT(A$2:A$12,LEN(F2))=F2,MATCH(A$2:A$12,A$2:A$12,0)),ROW(A$2:A$12)-ROW(A$2)+1),1))

    The SUM(IF(FREQUENCY array formula is more efficient (faster to calculate) especially on large data sets.
    It's been awhile since I visited this thread.

    Thank you for sharing that one. Until now I had always thought a reciprocating COUNT(1/FREQUENCY array formula was as good as it got.
    Last edited by FlameRetired; 07-13-2015 at 09:33 PM.

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

    Re: Help! Count not duplicates

    ______

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 10-23-2014, 04:50 PM
  2. [SOLVED] Count duplicates and duplicates with suffix as one instance
    By ruraljur0r in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-24-2014, 12:38 AM
  3. Removing duplicates in a count, count based on value in a different cell
    By omf_24 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-10-2013, 07:08 AM
  4. [SOLVED] Count Duplicates
    By Jonathan in forum Excel General
    Replies: 3
    Last Post: 04-08-2005, 11:06 AM
  5. [SOLVED] count a group of numbers but do not count duplicates
    By Lisaml in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-26-2005, 08:06 PM

Tags for this Thread

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