+ Reply to Thread
Results 1 to 2 of 2

Got a formula for comparing two sheets, need to adjust for an extra culumn.

  1. #1
    Registered User
    Join Date
    05-05-2017
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    12

    Question Got a formula for comparing two sheets, need to adjust for an extra culumn.

    Hey guys,

    "So I have two items lists with prices, one with prices from 2017 and the other with the prices of 2018. I need to combine the two items list and find out the difference in price between the years. the problem is that there are some items in the 2017 list that are not in the 2018 list and vice versa, so the lists do not exactly match in the rows. There is however a "material number" for each item to use as a reference if needed."

    I posted this earlier and somebody made a formula for me that worked awesome. I applied the formula to 4/5 of the set of lists I need to complete. The problem is on the last set of lists, there is an extra column with an extra cost and I am not sure how to edit the formula to account for the extra column.

    This is the formula I used:

    Named ranges:

    List1

    Refers to:='2017'!$A$2:$A$13

    List2

    refers to:

    ='2018'!$A$2:$A$13

    in Difference:

    in A2

    =IFERROR(IFERROR(INDEX(List1, MATCH(0, COUNTIF($A$1:A1, List1), 0)), INDEX(List2, MATCH(0, COUNTIF($A$1:A1, List2), 0))), "")

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    Copy down

    In B2

    =IFERROR(VLOOKUP($A2,'2017'!$A$2:$H$13,COLUMNS($A:B),0),VLOOKUP($A2,'2018'!$A$2:$H$13,COLUMNS($A:B),0))

    Copy Acroos to F and down

    in G2

    =IFERROR(VLOOKUP($A2,'2017'!$A$2:$H$13,7,0),"")

    in H2


    Repeat in I & J changing 2017 to 2018


    =IFERROR(VLOOKUP($A2,'2017'!$A$2:$H$13,8,0),"")


    Ill attach the file I need it to be done to so you can see exactly what needs to be done. The third sheet will be the sheet where It lists the prices of each year, and then the difference between the prices. I can calculate the difference in the prices myself so you don't have to waste your time with that, I mostly need help just joining the lists together and having the prices side by side.

    Thanks in advance!
    Attached Files Attached Files
    Last edited by VahidSamimi; 06-21-2017 at 02:10 PM.

  2. #2
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Got a formula for comparing two sheets, need to adjust for an extra culumn.

    You are in right path. I have just few changes.
    Also you can use index match instead of vlookup.
    Look attach file.
    Attached Files Attached Files


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

+ 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. cut and paste and navigating betwwen sheets and deleting extra sheets
    By bmbalamurali in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-10-2014, 01:13 PM
  2. [SOLVED] Formula for copying data in one culumn into data in one row
    By Losguapos1 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-03-2014, 01:29 PM
  3. Replies: 1
    Last Post: 02-12-2014, 01:49 AM
  4. [SOLVED] Comparing dates with extra condition
    By Wayprof in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-09-2013, 12:25 PM
  5. Replies: 3
    Last Post: 09-11-2012, 01:31 PM
  6. extra hours adding money for each extra hour worked FORMULA
    By cynthiamcastro in forum Excel General
    Replies: 3
    Last Post: 06-18-2012, 11:27 AM
  7. Excel 2007 : Excel Formula (comparing 2 sheets)
    By sandyl in forum Excel General
    Replies: 3
    Last Post: 12-01-2010, 03:39 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