+ Reply to Thread
Results 1 to 4 of 4

Need Help - How to compare two sets of data?

  1. #1
    Registered User
    Join Date
    04-28-2014
    Location
    New York
    MS-Off Ver
    Excel 2013
    Posts
    8

    Question Need Help - How to compare two sets of data?

    I attached an example file which clearly shows what I am trying to do. Here is the explanation:

    I have two sets of data. The first set has an item number and purchase price that I want to compare to a second set which is item number and sale price. The item number remains the same, I just need a formula that searches second data set to find the matching item number and compares the purchase price against the sale price to determine the profit or loss on each item number.

    Your help is appreciated!

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Need Help - How to compare two sets of data?

    I6 = Item #
    ;; either copy/paste it in somewhere, or just drag one set or the other, or whatever.

    J6 = purchase price - sale price
    ;; lookup (using INDEX(MATCH) construction) of the purchase price and sales prices from their respective tables indexed of the Item #, and then the net revinue from that.

    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Need Help - How to compare two sets of data?

    If you actually want to calculate profit or loss

    =(VLOOKUP(I6,$E$6:$F$45,2,FALSE)-VLOOKUP(I6, $A$6:$B$45,2,FALSE))/VLOOKUP(I6, $A$6:$B$45,2,FALSE)
    If you get an #N/A error, that means it didn't find that item in one of the lists. If you get #Div/0 error then it costs you nothing and you can't divide by zero (infinite profit).

    If you want simply "profit", "loss" or "even"
    =IF((VLOOKUP(I6,$E$6:$F$45,2,FALSE)-VLOOKUP(I6, $A$6:$B$45,2,FALSE))=0,"EVEN",IF((VLOOKUP(I6,$E$6:$F$45,2,FALSE)-VLOOKUP(I6, $A$6:$B$45,2,FALSE))>0, "PROFIT", "LOSS"))
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    04-28-2014
    Location
    New York
    MS-Off Ver
    Excel 2013
    Posts
    8

    Re: Need Help - How to compare two sets of data?

    Hi Chemist,

    Your formula works great. One last question - it there a way to add a column to show the actual dollar value for profit/loss in addition to the percentage?

+ 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. Formula to compare two different data sets
    By twoheadedgames in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-13-2014, 08:46 PM
  2. Compare 3 Data Sets Over Time
    By Cantaloop in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-25-2012, 07:27 PM
  3. Compare two data sets
    By VIJEXCEL in forum Excel General
    Replies: 1
    Last Post: 02-29-2012, 07:11 AM
  4. Compare two sets of data
    By Hollyoak08 in forum Excel General
    Replies: 3
    Last Post: 03-09-2010, 05:54 AM
  5. Compare two sets of data
    By Bhupinder Rayat in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-09-2005, 06:05 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