+ Reply to Thread
Results 1 to 8 of 8

Formula for counting values in one column based off of unique values in a different column

  1. #1
    Registered User
    Join Date
    10-15-2018
    Location
    Canada
    MS-Off Ver
    Windows 10
    Posts
    10

    Formula for counting values in one column based off of unique values in a different column

    Hi everyone,

    Attached is the sample worksheet.

    I have different individuals in a table(n=43) and I want to be able to count unique values in column Q(Attitude 1), based on unique values in column M (Last Name). How would I go about creating a formula for this?

    EDIT: To simplify, would it just be easier to count inuqe values in Column Q?

    Thanks

  2. #2
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,781

    Re: Formula for counting values in one column based off of unique values in a different co

    Raw data

    Q3=SUM(IF(FREQUENCY(IF(Q$8:Q$126=$P3,MATCH($M$8:$M$126,$M$8:$M$126,0)),ROW($M$8:$M$126)-ROW($M$8)+1),1)) control +shift +enter copy across and down
    Last edited by CARACALLA; 10-22-2018 at 06:12 PM.

  3. #3
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Formula for counting values in one column based off of unique values in a different co

    Please try at Q3 to R5

    =SUMPRODUCT(--(MATCH($M$8:$M$126,$M$8:$M$126,)*(Q$8:Q$126=$P3)=ROW($M$8:$M$126)-ROW($M$7)))

  4. #4
    Registered User
    Join Date
    10-15-2018
    Location
    Canada
    MS-Off Ver
    Windows 10
    Posts
    10

    Re: Formula for counting values in one column based off of unique values in a different co

    Ah this is exactly what I needed, thank you so much - however, when I try to copy and paste or rewrite the formula into another excel sheet, the formula gives me #VALUE!

    Ive noticed in your sheet, the formula displays {=SUM(IF(FREQUENCY(IF(Q$8:Q$126=$P3,MATCH($M$8:$M$126,$M$8:$M$126,0)),ROW($M$8:$M$126)-ROW($M$8)+1),1))} when I click on the cell,
    but using no "{....}" does not work. Any suggestions?

  5. #5
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,781

    Re: Formula for counting values in one column based off of unique values in a different co

    After you type in the formula, don't just press enter.
    Instead, press CTRL + SHIFT + ENTER

    If you've already entered the formula, then highlight the cell with the formula and press F2.
    Then press CTRL + SHIFT + ENTER

  6. #6
    Registered User
    Join Date
    10-15-2018
    Location
    Canada
    MS-Off Ver
    Windows 10
    Posts
    10

    Re: Formula for counting values in one column based off of unique values in a different co

    Ahhh beautiful - wow thank you!! It is deeply appreciated!

    Just out of curiosity, what does CTRL + SHIFT + ENTER do?

  7. #7
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,781

    Re: Formula for counting values in one column based off of unique values in a different co


  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Formula for counting values in one column based off of unique values in a different co

    Ctrl Shift Enter tells Excel to treat your formula as an array formula.

+ 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. Counting cells in one column based on unique values in another column
    By 3SixOne in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-13-2017, 06:23 AM
  2. Counting unique values based on another column
    By tfagan1978 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-04-2017, 04:00 AM
  3. [SOLVED] Sum values in column based on unique values in correlating column.
    By ericbinfet in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-04-2015, 01:04 AM
  4. [SOLVED] Sum values in column based on unique values in correlating column.
    By ericbinfet in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-03-2015, 11:41 AM
  5. Replies: 2
    Last Post: 08-19-2015, 10:22 AM
  6. Counting unique values based on condition in a different column
    By rafuk73 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-21-2014, 02:59 PM
  7. [SOLVED] Counting # of specific values in one column for each unique IP in another column
    By Light C in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 06-04-2013, 11:38 AM

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