+ Reply to Thread
Results 1 to 10 of 10

How to use vlookup with unique id to calculate sum

  1. #1
    Registered User
    Join Date
    07-01-2021
    Location
    New Jersey, US
    MS-Off Ver
    Microsoft 365
    Posts
    5

    How to use vlookup with unique id to calculate sum

    In the attached excel file, how do I utilize vlookup using the unique ids to sum up the total cost of each fruit?
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,956

    Re: How to use vlookup with unique id to calculate sum

    is this what you want?
    =SUMIF($A$2:$A$7,F2,$D$2:$D$7)

    (not quite sure how you want teh "unique" to figure in?)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    07-01-2021
    Location
    New Jersey, US
    MS-Off Ver
    Microsoft 365
    Posts
    5

    Re: How to use vlookup with unique id to calculate sum

    I want to specifically use vlookup using the unique identifiers to find the cost associated with that id

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,956

    Re: How to use vlookup with unique id to calculate sum

    OK so which value do you want returned...and why the insistence on using VLOOKUP (which may or may not be the function you need)?

  5. #5
    Registered User
    Join Date
    07-01-2021
    Location
    New Jersey, US
    MS-Off Ver
    Microsoft 365
    Posts
    5

    Re: How to use vlookup with unique id to calculate sum

    I would like the total cost returned, for example the total cost of each apple returned in the column to the right, vlookup is just a preference to see if it can be done using the unique ids for each fruit.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,956

    Re: How to use vlookup with unique id to calculate sum

    Did you try my sumif function?

  7. #7
    Registered User
    Join Date
    07-01-2021
    Location
    New Jersey, US
    MS-Off Ver
    Microsoft 365
    Posts
    5

    Re: How to use vlookup with unique id to calculate sum

    I did try that and that works, my problem comes when there are similar names but unique ids, for instance when using your SUMIF response it is using the names from column 1 to do sumif, what if I have something like this in the attached photo, where there a is an apple with 2 unique ids, how will you go about doing that summation.
    Attached Images Attached Images

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,485

    Re: How to use vlookup with unique id to calculate sum

    =sumifs($d$2:$d$7,$a$2:$a$7,f2,$b$2:$b$7,g2)
    Quang PT

  9. #9
    Registered User
    Join Date
    07-01-2021
    Location
    New Jersey, US
    MS-Off Ver
    Microsoft 365
    Posts
    5

    Re: How to use vlookup with unique id to calculate sum

    This works, Thank you!!

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,956

    Re: How to use vlookup with unique id to calculate sum

    Thanks for the feedback

    And thanks for the assist Quang

+ 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. Want to calculate unique instances of event
    By nady94 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-31-2019, 08:45 AM
  2. [SOLVED] not able to calculate unique values
    By canusesomeexcelhelp in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 04-09-2017, 06:41 AM
  3. [SOLVED] Calculate the unique values
    By Villalobos in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-24-2015, 04:02 AM
  4. Formula to calculate how many unique items
    By James404 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-06-2012, 12:28 PM
  5. [SOLVED] Sort per unique P/N (A), and calculate total for each P/N
    By Zadok in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-12-2012, 03:18 AM
  6. Formula to calculate total for each unique value
    By sashwin99 in forum Excel General
    Replies: 4
    Last Post: 10-08-2010, 07:47 AM
  7. How to calculate rows for unique records?
    By sheclaire in forum Excel General
    Replies: 1
    Last Post: 03-29-2007, 03:24 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