+ Reply to Thread
Results 1 to 8 of 8

Extract unique items for two columns and get totals

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Extract unique items for two columns and get totals

    Hello everyone
    I have three sheets (two would be the data input : Data1 and Data2)
    I have in these two sheets : column C for items and column D for Type and in column E I have the amount for each item & type

    In Result sheet I need to extract unqiue items (Item & Type) from both sheets and get the total amount for them
    After that substract the two amount extracted in column G in sheets("Result")

    For example :
    The item "Eggs" & the Type "Kind2" in sheets("Data1") exist in row 7 and row 19 .. the amount = 30 + 4 =34
    The item "Eggs" & the type "Kind2" in sheets("Data2") exist in row 14 and row 18 .. the amount = 2 + 4 = 6

    So in result sheet I would like to have the Item name and its Type and the total amount in both sheets (each amount in each sheet) and calculate the difference between Data1 - Data2 related that item
    The expected result for that example will be:
    Columns: C D E F G
    Eggs Kind2 34 6 28

    Hope it is clear
    Thanks advanced for help
    Attached Files Attached Files
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  2. #2
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Extract unique items for two columns and get totals

    I'd suggest pivot table.Copy sheet two to the bottom of sheet 1 data, move far right column of the sheet 2 columns to the right one column and label this column data2. This way you'll have all data in one sheet with 4 data columns - item, kind, data1amount, data2amount then run a pivot table to find the sums of data1amount and data2 amount for each item and kind, then a calculated field to find the difference.
    Last edited by Crooza; 02-15-2016 at 09:00 PM.
    Happy with my advice? Click on the * reputation button below

  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Extract unique items for two columns and get totals

    Is it possible to do it with codes .. I don't prefer pivot tables (although I know it is a strong tool) this is a point and another point I need to do some other tasks related to these two sheets.. these columns are for the sample file but there are many other columns related to both sheets

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Extract unique items for two columns and get totals

    Maybe :

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Extract unique items for two columns and get totals

    Really really awesome & wonderful Mr. Karedog
    How can you type these magic lines?!!
    Just a little point : What about column G ? I need to get the remain (the difference between the two amounts) .. Just refer me to the line I should add
    Thank you very much for this great and perfect help

  6. #6
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Extract unique items for two columns and get totals

    Ah, I only read first half of OP, and missed the rest. Here it is :

    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Extract unique items for two columns and get totals

    Mr. Karedog
    YOU ARE GENIUS. You have solved a lot of my issued in perfect way. You gave me unique and perfect solutions
    Thanks is not enough for all this great help ..but I have to say it (although it is not enough as the words are unable to thank you)
    Thank you very much
    Best Regards

  8. #8
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Extract unique items for two columns and get totals

    You are welcome, and many many thanks for the kind words.


    Regards

+ 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 Unique Items in a Column Based on Unique Items in Two Other Columns
    By HangMan in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 10-31-2015, 04:48 PM
  2. [SOLVED] Extract unique items based on criteria
    By YasserKhalil in forum Excel General
    Replies: 4
    Last Post: 09-03-2015, 03:29 AM
  3. [SOLVED] Extract Unique Items (No VBA/No Helper Cells)
    By NeedForExcel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-24-2015, 03:09 AM
  4. Extract unique items based on criteria
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-08-2015, 03:10 PM
  5. Extract a sorted and ranked unique list of items
    By bruno_ in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-11-2013, 09:52 PM
  6. Extract unique items from a Table and place in a column
    By Evilshrew in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-28-2007, 02:36 AM
  7. Extract Unique Items
    By GreenLotus in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-15-2007, 09:00 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