+ Reply to Thread
Results 1 to 15 of 15

Count unique values based on criteria without using array

  1. #1
    Registered User
    Join Date
    01-06-2014
    Location
    Ames, Iowa
    MS-Off Ver
    Excel 2010
    Posts
    14

    Count unique values based on criteria without using array

    I have a large worksheet with multiple columns of arrays which slow everything down and I'd like to replace each of them with a helper column and another formula which would hopefully speed things up. I have attached an example.

    Column D is the array formula which I'm trying to replace. It counts the unique values in Column A if the criteria in Column B and Column C are matched.

    I've entered a Helper column and formula (although this can be changed if needed). For each value in the Helper column a count of unique values in Column A should be made and place in Column H.

    I have several of these arrays to replace but getting through one should allow me to finish the rest.



    I also have a second question which is separate from the question above and more for my understanding. I adjusted the array in Column D for the attached example and it didn't count correctly. How come in Column D when I use a range extending to row 100 it works but if I adjust it to the actual range of the table (to row 51) as in Column E it gives the wrong information.


    Thanks for the help,
    Jon
    Attached Files Attached Files
    Last edited by jonpaulson; 10-10-2014 at 10:43 AM.

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Count unique values based on criteria without using array

    Download and install the FREE MICROSOFT PowerPivot Addin. It allows for Unique Count natively.

    http://chandoo.org/wp/resources/dist...t-power-pivot/
    http://blog.contextures.com/archives...l-pivot-table/
    https://www.youtube.com/watch?v=1YJ0GMFm7IM

    Once you have powerpivot you can solve this in seconds and wonder why Excel didnt have this BEFORE the addin.
    Last edited by mikeTRON; 10-09-2014 at 05:22 PM.
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Registered User
    Join Date
    01-06-2014
    Location
    Ames, Iowa
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Count unique values based on criteria without using array

    Thanks, but not an option.

  4. #4
    Registered User
    Join Date
    01-06-2014
    Location
    Ames, Iowa
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Count unique values based on criteria without using array

    Any help? thanks

  5. #5
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Count unique values based on criteria without using array

    I'm just not sure what your arrays/helper column are attempting to accomplish. For example, Cell D7 returns a value of 3. Can you tell me which cells are being counted that sum to 3?

  6. #6
    Registered User
    Join Date
    01-06-2014
    Location
    Ames, Iowa
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Count unique values based on criteria without using array

    There are 3 unique values in Column A for which the Sequence = 14466 and Flat/Round = R

    They are:
    14466/24/20R
    14466/20/17R
    14466/20/16R

  7. #7
    Registered User
    Join Date
    01-06-2014
    Location
    Ames, Iowa
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Count unique values based on criteria without using array

    The helper column is not being used currently but it was a starting attempt at splitting up the array in Column D.

  8. #8
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Count unique values based on criteria without using array

    If you don't want to use arrays, you can obtain the unique counts by performing a couple "Remove Duplicate" operations and a =COUNTIF function.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    01-06-2014
    Location
    Ames, Iowa
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Count unique values based on criteria without using array

    Are you sure you attached the right document?

  10. #10
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Count unique values based on criteria without using array

    Oops, I most certainly did not post the correct one. Too many files named Book 1. Sorry.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    01-06-2014
    Location
    Ames, Iowa
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Count unique values based on criteria without using array

    Thanks but that's not going to work as the data table is set and I can't remove duplicates like you did and then count. The data in columns A-C can't be modified.

  12. #12
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Count unique values based on criteria without using array

    Well I'm not sure why you can't just perform the modification in a separate tab like I did, which keeps your original data in tact. However, given these constraints, I'm not sure how to achieve your desired output without using an array. Perhaps someone else will see this and be able to figure it out.

  13. #13
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Count unique values based on criteria without using array

    Maybe this will be of use. I added two helper columns the second of which gives the results of the original column D. Neither of the formulae are Array formulae. What I have done is highlighted in Yellow.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  14. #14
    Registered User
    Join Date
    01-06-2014
    Location
    Ames, Iowa
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Count unique values based on criteria without using array

    Works, thanks for the help.

  15. #15
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Count unique values based on criteria without using array

    Thanks for giving feedback.

+ 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. [SOLVED] Count unique values in columns based on 2 criteria
    By t83357 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-12-2013, 04:33 PM
  2. Extract Unique Values from an Array based on Criteria
    By ronleex324 in forum Excel General
    Replies: 1
    Last Post: 10-04-2011, 06:37 PM
  3. Count unique values based on several criteria
    By evilgrin in forum Excel General
    Replies: 2
    Last Post: 10-10-2010, 03:50 PM
  4. Count unique values based on matching criteria
    By gromitw in forum Excel General
    Replies: 9
    Last Post: 01-10-2007, 08:59 AM
  5. how to count unique values in excel based on criteria
    By Jorge in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-13-2005, 10:06 AM

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