+ Reply to Thread
Results 1 to 4 of 4

Compare two sets of data and join together

  1. #1
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,173

    Compare two sets of data and join together

    I have two data sheets that I need to compare. Sheet one contains agent IDs and all their customers for each state. The second sheet contains the registrations the agent holds for each state (registrations can be at the city level, state level, or no registration at all)

    The first step is to consolidate the first data sheet. For example, there may be 10 line items for one agent. Of the 10 line items, 4 customers reside in NY, 3 reside in NJ, and 3 reside in CT. This would be consolidated into 3 line items, which would be agent ID, agent name, the state, and number of clients in each state:

    Agent ID.....Name......State......Clients
    123456.......Joe............NY.............4
    123456.......Joe............NJ.............3
    123456.......Joe............CT.............3

    The second, and last step, is to determine the registration level the agent has for each state, if any. So the final output may be as follows:

    Agent ID.....Name......State......Clients.........Registration
    123456.......Joe............NY.............4...................STATE
    123456.......Joe............NJ.............3....................CITY
    123456.......Joe............CT.............3....................CITY

    Attached is sample data along with desired output. Thanks for any comments.
    Attached Files Attached Files
    Last edited by maacmaac; 09-10-2010 at 10:00 AM.

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Compare two sets of data and join together

    First thing you should do is make a unique list from DataSheet using advanced filter.

    I made my list on sheet DataSheet in E1:G15

    http://www.contextures.com/xladvfilter01.html

    Next, in H2 =SUMPRODUCT(--($B$2:$B$27=F2),--($C$2:$C$27=G2))

    This will give you the number of time the state is connected with a certain person.

    Finally, in I2 =INDEX(Registrations!$C$2:$BB$12,MATCH(F2,Registrations!$B$2:$B$12,0),MATCH(G2,Registrations!$C$1:$BB$1,0))

    This will return City, State, etc.,
    Attached Files Attached Files

  3. #3
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,173

    Re: Compare two sets of data and join together

    Thanks for feedback. Works perfectly.

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Compare two sets of data and join together

    You're welcome

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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