+ Reply to Thread
Results 1 to 15 of 15

Grouping table data into smaller table

  1. #1
    Registered User
    Join Date
    10-22-2015
    Location
    KL, Malaysia
    MS-Off Ver
    MS Office 2010
    Posts
    17

    Grouping table data into smaller table

    Hi there,
    I'm hoping anyone could enlighten me on how to group a list of data in a table, into a new table with grouped data, WITH the sum added up.

    For instance,
    <Subject><Input><Outcome>
    AA-100-6200
    AB-150-4100
    BA-450-8000
    BB-600-2150
    ...

    Into a new table where all are categorized into the first alphabet,
    <Subject><Input><Outcome>
    A-250-10300
    B-1050-10150
    ...

    Many thanks!
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,703

    Re: Grouping table data into smaller table

    Put this formula in F2:

    =SUMIF($A:$A,$E2&"*",B:B)

    and it should copy down automatically.

    Copy into G2, and again it should fill the cells below.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    10-22-2015
    Location
    KL, Malaysia
    MS-Off Ver
    MS Office 2010
    Posts
    17

    Re: Grouping table data into smaller table

    Quote Originally Posted by Pete_UK View Post
    Put this formula in F2:

    =SUMIF($A:$A,$E2&"*",B:B)

    and it should copy down automatically.

    Copy into G2, and again it should fill the cells below.

    Hope this helps.

    Pete
    Hi Pete, thanks for the help, it helped but only in a short term.
    As this is in alphabetical order, in future, what if the subject on the first table and the subject in the second table aren't in alphabetical form?

    For instance, I have a list of members with their names in Table 1

    <Salesperson><Number of Packages Sold><$ Sales>
    Peter-100-6200
    Paul-150-4100
    Mary-450-8000
    Jess-600-2150
    ...(n>100)

    <Sales Managers><Number of Packages Sold from their members><$ Sales>
    John-550-14200
    Jane-750-6250
    ...(n>20)
    *where Peter and Mary is under John, where Paul and Jess is under Jane

    Is there a coding/function that could facilitate this? Thanks!
    Last edited by kenny_kk; 11-05-2015 at 08:46 PM. Reason: Bolding

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,703

    Re: Grouping table data into smaller table

    It doesn't matter what order the original table is in - try it by sorting the first table on the second field.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    10-22-2015
    Location
    KL, Malaysia
    MS-Off Ver
    MS Office 2010
    Posts
    17

    Re: Grouping table data into smaller table

    Fair enough, Pete.
    But the problem is for instance

    A with the value of 10,211, is the total of AAM, ABB, ACG, AD, ASA, ASWQ and AYR.

    Say that I replace 'A' into John, or even I replace 'AAM' into 'Peter', the number will go off.
    (i.e., AAM being 206, the subject is being replaced to 'Peter', A will turned into 10,005, because 206 is taken away from 10,211)

    Reason that I would like it to be automated for the second table is because I will need to have the graph automatically generated, sales according to the sales manager, once there are changes to even a single salesperson.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Grouping table data into smaller table

    Do you have another column that identifies common teams?
    Dave

  7. #7
    Registered User
    Join Date
    10-22-2015
    Location
    KL, Malaysia
    MS-Off Ver
    MS Office 2010
    Posts
    17

    Re: Grouping table data into smaller table

    I have the file attached again, this time it's clearer.

    The main issue is that I will be receiving the packages sold and sales number pretty much daily and weekly, but there's only <name>, <packages sold> and <sales (revenue)>.

    Hence, I would definitely have to put it into Excel every time I receive the figure report, especially the <name>, <packages sold> and <sales (revenue)>.

    Now the main issue is that, it would be easy and hassle-free if I were to create a chart showcasing all the salesperson and their figures, but it's almost ridiculous since there's about 100+ salesperson in reality, hence it's better to segregate it via team, team that show the total packages sold for the team-members and the total sales generated.

    Could this actually be done in Excel?
    Attached Files Attached Files

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Grouping table data into smaller table

    Then in column G of the summary table do this formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and one like it in column H
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    10-22-2015
    Location
    KL, Malaysia
    MS-Off Ver
    MS Office 2010
    Posts
    17

    Re: Grouping table data into smaller table

    Quote Originally Posted by FlameRetired View Post
    Then in column G of the summary table do this formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and one like it in column H
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Thanks FlameRetired, this is under the assumption that the column for 'Team Leader' is perfectly sorted. What if.... say, the reporting team have the name scattered, or even some names that are missing (i.e. Daniel and Anna's figures are yet to be confirmed, hence their name is not there?)

    Is there such function whereby like
    If Column A (Name) is 'Anna', Column B (Team leader) is 'Kenny' and so on? If there is, then this formula would be perfect for the bar chart generation for all the team.

    As in, program the Excel to recognize the name into its respective Team Leader.

    PS:Many thanks for all the time and effort!

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Grouping table data into smaller table

    The order of team leaders won't effect the totals. And since the conditional in the SUMIF formula is team leaders (the common link) if team members (not leaders) are missing from the main data table they just won't be included in the sum until their figures are tallied. However the rest of the team members numbers will be tallied. All the names can be scattered up and down that main data table. That's one of the things that makes SUMIF(S) so powerful. It sorts all that stuff out.

  11. #11
    Registered User
    Join Date
    10-22-2015
    Location
    KL, Malaysia
    MS-Off Ver
    MS Office 2010
    Posts
    17

    Re: Grouping table data into smaller table

    Quote Originally Posted by FlameRetired View Post
    The order of team leaders won't effect the totals. And since the conditional in the SUMIF formula is team leaders (the common link) if team members (not leaders) are missing from the main data table they just won't be included in the sum until their figures are tallied. However the rest of the team members numbers will be tallied. All the names can be scattered up and down that main data table. That's one of the things that makes SUMIF(S) so powerful. It sorts all that stuff out.
    Precisely, Flame.
    I can see and understand that the figures are all good even when the names are scattered.

    But my point is that, what if my finance department or so, were to provide me a raw list of salesperson with their packages sold along with sales (revenue) without their respective team leader in the column next to the salesperson? Does it mean I will have to manually key in the team leader for each of the salesperson?

    Bear in mind this is just a simplistic data with 21 salesperson, what if I have 100+ salesperson where I can't remember their respective team leader (20+ of them)?

    Thanks.

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,147

    Re: Grouping table data into smaller table

    On your last point: create a table of salespersons and respective team leaders. You could then use VLOOKUP (or similar) to fill in missing team Leaders.

  13. #13
    Registered User
    Join Date
    10-22-2015
    Location
    KL, Malaysia
    MS-Off Ver
    MS Office 2010
    Posts
    17

    Re: Grouping table data into smaller table

    Quote Originally Posted by JohnTopley View Post
    On your last point: create a table of salespersons and respective team leaders. You could then use VLOOKUP (or similar) to fill in missing team Leaders.
    Yes, JohnTopley! I've heard of people suggesting vlookup but I am totally clueless on how to work it out.

    I have updated and attached another attachment with the salesperson and the directory in a separate table. Could you probably assist to put the vlookup formula so I could study it and apply it to all 100+ of my salesperson and 20+ sales manager/team leader?

    Thanks all!
    Attached Files Attached Files

  14. #14
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,703

    Re: Grouping table data into smaller table

    Put this formula in B2:

    =IFERROR(VLOOKUP(Table1[[#This Row],[Name]],Table3,2,0),"not listed")

    It should automatically copy down. You can add a Not Listed category at the bottom of Table 2 to check that totals all match.

    Hope this helps.

    Pete

  15. #15
    Registered User
    Join Date
    10-22-2015
    Location
    KL, Malaysia
    MS-Off Ver
    MS Office 2010
    Posts
    17

    Re: Grouping table data into smaller table

    Quote Originally Posted by Pete_UK View Post
    Put this formula in B2:

    =IFERROR(VLOOKUP(Table1[[#This Row],[Name]],Table3,2,0),"not listed")

    It should automatically copy down. You can add a Not Listed category at the bottom of Table 2 to check that totals all match.

    Hope this helps.

    Pete
    Good God, Pete!
    Thanks a million! My saviour!
    Now my sales performance report could be done easily especially when my manager wants it pretty much like instantly.

+ 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. Summerize tables on data base to smaller dynamic table
    By x_ampl1 in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 10-23-2014, 06:22 AM
  2. Replies: 2
    Last Post: 01-20-2014, 07:05 PM
  3. [SOLVED] Getting data from a huge table to a smaller and organized one.
    By Eldernurf in forum Excel General
    Replies: 4
    Last Post: 10-24-2013, 02:55 PM
  4. [SOLVED] Getting data from table into smaller tables on a seperate sheet
    By FootyMan in forum Excel General
    Replies: 5
    Last Post: 08-27-2013, 10:25 AM
  5. Displaying large table into smaller table
    By FlynHokie in forum Excel General
    Replies: 3
    Last Post: 12-08-2012, 10:49 AM
  6. Replies: 4
    Last Post: 01-27-2012, 09:50 AM
  7. Filtering data from one large table into many smaller ones based on certain criteria.
    By hugedomer11 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-11-2010, 12:57 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