+ Reply to Thread
Results 1 to 4 of 4

Annual summary with categories and matching

  1. #1
    Registered User
    Join Date
    12-12-2009
    Location
    Seattle
    MS-Off Ver
    Excel 2007
    Posts
    2

    Annual summary with categories and matching

    I am trying to produce a table of annual cost from a monthly data sheet of different countries without the use of pivot table, while replace a column by matching with a reference table.

    For example, these are the tables:

    Monthly cost:

    Country | Item | Date | Cost |
    ----------------------------------
    X | A | Jun-09 | $10 |
    __| B | Jul-09 | $5 |
    __| D | Jul-09 | $10 |
    Y | A | Jun-08 | $20 |
    __| C | Jun-09 | $10 |
    __| E | Aug-09 | $5 |
    ----------------------------------

    Item reference:

    Type | Category | Item |
    ---------------------------
    Food | Meat | A |
    _____| Meat | B |
    _____| Wheat | C |
    Energy| Nuclear | D |
    ______| Gas | E |
    ---------------------------

    And the resulting table would be:

    Year | Country | Category | Cost |
    ---------------------------------------
    2008 | Y | Meat | $20 |
    2009 | X | Meat | $15 |
    _____| X | Nuclear | $10 |
    _____| Y | Wheat | $10 |
    _____| Y | Gas | $5 |



    Is there anyway to do this through a single step/function? Or do I need to copy the original table to a new worksheet, fill in the blanks, reorder, reformat and filter the columns, and etc?

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Help: Annual summary with categories and matching

    Please attach a sample workbook that exactly represent your real structure and clearly shows the expected/desired results and a clear explanation. It will save time and get you a precise answer more quickly.

    To attach a file: when posting, scroll down the page until you see the section titled "Attach Files". Click on Manage Attachment. It should be intuitive from there.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    12-12-2009
    Location
    Seattle
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Help: Annual summary with categories and matching

    Quote Originally Posted by Palmetto View Post
    Please attach a sample workbook that exactly represent your real structure and clearly shows the expected/desired results and a clear explanation. It will save time and get you a precise answer more quickly.

    To attach a file: when posting, scroll down the page until you see the section titled "Attach Files". Click on Manage Attachment. It should be intuitive from there.
    Sorry about that. I have attached an example attached, and the purpose is to produce the table in the "Output" tab with annual cost from the "Monthly Cost" tab. The table should include year, country, and lastly category (which you need to match the item column from the "Monthly Cost" tab with the "Item Reference" tab to find the right category.
    Attached Files Attached Files

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Annual summary with categories and matching

    In order to achieve the results you show you on the Output sheet you must add a Category column on the Monthly Cost sheet to fully associate the values.

    After adding the additional column, an INDEX/MATCH formula was used to return the associated category for the item.

    =INDEX('Item Reference'!$B$2:$B$6,MATCH('Monthly Cost'!B2,'Item Reference'!$C$2:$C$6,0))

    Also, you cannot have blank cells in the table as you have on the Monthly Cost sheet and the Output sheet. I have filled them in by manually associated the values based on your totals.

    This SUMPRODUCT formula will provide the results you asked for.
    =SUMPRODUCT(--(YEAR('Monthly Cost'!$C$2:$C$7)=Output!A2),--('Monthly Cost'!$A$2:$A$7=Output!B2),--('Monthly Cost'!$E$2:$E$7=Output!C2),('Monthly Cost'!$D$2:$D$7))

    See attached.
    Attached Files Attached Files

+ 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