+ Reply to Thread
Results 1 to 4 of 4

List Multiple Occurrences and then move one, Repeat Name as Many Times as it Exists

  1. #1
    Registered User
    Join Date
    12-14-2020
    Location
    Virginia
    MS-Off Ver
    MS 365
    Posts
    12

    Question List Multiple Occurrences and then move one, Repeat Name as Many Times as it Exists

    Hope I describe this well enough, but I've attached an example file.

    I have a large data set of every employee and the locations they work at, some employees work at multiple locations. I want a formula that will pull in all the employees associated with a location entered in a cell, which I know how to do, but I also want to list all the locations that those employees work out of which I don't know how to do. So I need a formula that will repeat the employee # as many times as it appears in the data set and then go on to the next employee, and also a formula that will do the same for the locations associated with the employee (like an index match that won't repeat).

    Data Set
    Employee ID # Location #
    123 A
    123 B
    150 C
    160 C
    170 A
    170 B
    170 C
    180 C

    Pull In all Employees at A (I use = Small(IF(Location = A, Empolyees),Row()-Row())
    123
    170

    All Locations that Employees at A work at
    123 A
    123 B
    170 A
    170 B
    170 C
    Attached Files Attached Files
    Last edited by budfox310; 04-21-2021 at 12:35 PM.

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

    Re: List Multiple Occurrences and then move one, Repeat Name as Many Times as it Exists

    E4=IFERROR(AGGREGATE(15,6,$B$4:$B$100/($C$4:$C$100=$E$2),ROWS($E$4:E4)),"")

    Copy down


    I4=IFERROR(INDEX(B$4:B$100,AGGREGATE(15,6,ROW($B$4:$B$100)-ROW(B$4)+1/(ISNUMBER(MATCH($B$4:$B$100,$E$4:$E$12,0))),ROWS($B$4:B4))),"")

    Copy across and down


    formulas is manual in your Excel change in automatic
    Attached Files Attached Files
    Last edited by CARACALLA; 04-21-2021 at 01:36 PM.

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: List Multiple Occurrences and then move one, Repeat Name as Many Times as it Exists

    i used a helper column F. Set F3 = 0. In F4
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    In K4 copied down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In L4 copied down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    12-14-2020
    Location
    Virginia
    MS-Off Ver
    MS 365
    Posts
    12

    Re: List Multiple Occurrences and then move one, Repeat Name as Many Times as it Exists

    Wow, this is great, I've never used the aggregate function before so I'll need to figure out exactly how it works. The data is on a different tab with 5000 rows so I just switched the cell references accordingly and it works well.

+ 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: 1
    Last Post: 01-31-2020, 11:27 PM
  2. List data from a table with multiple headers? Index, Small, Lookup??
    By KDB13 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-06-2019, 08:53 AM
  3. Small/Index to Pull Specific Instances and Leave out cells unpopulated.
    By donnieboy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-12-2015, 06:08 AM
  4. [SOLVED] Complex VLOOKUP, multiple instances vertical, return subsequent instances horizontally
    By Miles_2804 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-12-2013, 11:54 AM
  5. Replies: 3
    Last Post: 07-18-2012, 11:53 AM
  6. Finding all Instances of a certain value in a small excel spreadsheet
    By CircuitAkita in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-19-2011, 01:37 AM
  7. Extracting/look up data from a list and select multiple instances
    By Candice H. in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-29-2005, 12:06 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