+ Reply to Thread
Results 1 to 9 of 9

Count multiple ids for same person

  1. #1
    Forum Contributor
    Join Date
    04-30-2012
    Location
    US
    MS-Off Ver
    Office 365 and 2021
    Posts
    122

    Count multiple ids for same person

    I am trying to count how many ids an employee holds. Please see attached. So if one employee has three different ids, it should say 3, and if they have only 1 then 1.

    Thanks,
    Rae
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,067

    Re: Count multiple ids for same person

    It depends on what you want to happen in the case of rows 9 & 10. Shold they be 1 or 2??

    If 2:

    =COUNTIF(B:B,B2)
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: Lá fhéile Pádraig sona dhaoibh

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,067

    Re: Count multiple ids for same person

    ...and if they should return 1:

    =SUM(INDEX(($B$2:$B$15=B2)/COUNTIFS($B$2:$B$15,$B$2:$B$15&"",$A$2:$A$15,$A$2:$A$15&""),0))
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    04-30-2012
    Location
    US
    MS-Off Ver
    Office 365 and 2021
    Posts
    122

    Re: Count multiple ids for same person

    it should be 1. Basically trying to count which employee has multiple ids. So if they have two unique ids, it should say 2. Sorry about the confusion.

  5. #5
    Forum Contributor
    Join Date
    04-30-2012
    Location
    US
    MS-Off Ver
    Office 365 and 2021
    Posts
    122

    Re: Count multiple ids for same person

    Cool. Great. Thanks so much.. Let me populate this into my data file. will report back if there's any issue.

  6. #6
    Forum Contributor
    Join Date
    04-30-2012
    Location
    US
    MS-Off Ver
    Office 365 and 2021
    Posts
    122

    Re: Count multiple ids for same person

    I've got about 32,000 rows to calculate, so excel if frozen Will wait for it to populate the formula.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,067

    Re: Count multiple ids for same person

    Hi. This is VERY fast with 32,000 rows... It took about 90 seconds to calculate all 32,000 rows in a sample sheet

    =SUM(IF(FREQUENCY(IF(($B$2:$B$32000=B2),$A$2:$A$32000),$A$2:$A$32000),1))

    In YOUR version of Excel it may need to be entered as an array formula.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    04-30-2012
    Location
    US
    MS-Off Ver
    Office 365 and 2021
    Posts
    122

    Re: Count multiple ids for same person

    Thanks Glenn. The issue is that column A has id numbers stored as text and if convert it to numbers, it will remove 0s at the beginning of each id. I can copy the column to retain the original values and use a copied column and convert it to numbers in order to use the formula you recommended by using Frequency function.

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,067

    Re: Count multiple ids for same person

    That'll work. I did try atext-friendly alternative to that with FREQUENCY & MATCH, but first time my PC crashed. Then, on its second outing, the formula decided to stop working if the range was increased beyond about 1000 rows.

+ 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 Specific to Person If Value True
    By theexcelnovice123 in forum Excel General
    Replies: 6
    Last Post: 01-17-2020, 09:57 AM
  2. Count number of shift done by particular person
    By Vikas09 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 09-30-2017, 09:50 PM
  3. [SOLVED] Count if there is a new order/ sum if there are multiple items being ordered by one person
    By sweetlakia in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-28-2016, 02:50 PM
  4. Count consecutive dates by person
    By KylerStern in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-14-2015, 04:05 PM
  5. VBA to convert person-to-event into person-person
    By LuckyStrike in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-07-2014, 02:34 PM
  6. Transpose/Pivot multiple rows per person into 1 row per person with fixed columns
    By MaestroEnrique in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2013, 06:35 AM
  7. [SOLVED] Count of instances of offenses per person
    By bpiroma in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-07-2012, 05:16 PM

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