+ Reply to Thread
Results 1 to 8 of 8

Vlookup ?

  1. #1
    Forum Contributor
    Join Date
    11-26-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    429

    Vlookup ?

    Hi there i want to be able to extract the data from column C in sheet2 and replace it onto column C in sheet 1 , but only if column A (car reg) matches in both sheets

    for instance the price of a car in sheet 1 need to change to the price in sheet 2, i have got a sheet at work that has thousands of rows , how can i do this quickly.

    Please help
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Vlookup ?

    Put this formula in D2 of Sheet1:

    =IFERROR(VLOOKUP(A2,Sheet2!A:C,3,0),C2)

    and copy down to the bottom of your data. Then fix the values in column D - to do this select column D by clicking on the column identifier, then click <copy>, then right-click and select Paste Special from the drop-down, then click on Values | OK and then press the <Esc> key.

    Then you can delete column C of Sheet1 (unless you wish to retain the previous values).

    Hope this helps.

    Pete

  3. #3
    Forum Contributor
    Join Date
    11-26-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    429

    Re: Vlookup ?

    pete this came back with the correct prices , but i also gives me a price for A16 (dd58htx) in sheet 1, which is not in sheet 2

    it should only update if the car reg is in both sheets, the car reg could also be in different row numbers in column A
    Last edited by dougers1; 10-22-2015 at 02:57 PM.

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Vlookup ?

    The reason it gave you that price is because the formula Pete gave you returns the value in the matching cell in sheet1 (in this case cell C16) in the event there is an error (#N/A result).
    Maybe this will work better for you...
    =IFERROR(IF(VLOOKUP(A2,Sheet2!A:C,3,FALSE)=VLOOKUP(A2,Sheet2!A:C,3,FALSE),VLOOKUP(A2,Sheet2!A:C,3,FALSE)),"no price available")
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  5. #5
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Vlookup ?

    this one BTW is probably cleaner and I like better... =IFERROR(INDEX(Sheet2!C:C,MATCH(Sheet1!A2,Sheet2!A:A,0)),"not on sheet2") copied down.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,433

    Re: Vlookup ?

    I would have done the same as Pete. If the registrations match, it returns the price from sheet2. If it doesn't, it returns the existing price from Sheet1, column C.

    My take:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If that's not what, you want then:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,433

    Re: Vlookup ?

    Sorry, just to add, as Pete explained, the advantage of his formula is that you get a complete column of values, new and original. You can then convert that to values and delete the original column C if you wish.

    Regards, TMS

  8. #8
    Forum Contributor
    Join Date
    11-26-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    429

    Re: Vlookup ?

    Thanks Guy's this has helped me big time.

+ 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] When vlookup ragnes is mutiple: How do vlookup value finding occurrence against coresspond
    By silambarasan.J in forum Excel Formulas & Functions
    Replies: 34
    Last Post: 07-07-2015, 09:32 AM
  2. Using vLookup based on results from a vLookup & returning an undetermined list
    By NormalityBan in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 08-14-2014, 05:02 AM
  3. Replies: 0
    Last Post: 12-26-2013, 01:12 PM
  4. Display Cell within VLookup range that excel thinks matches the VLookup Value
    By headachexcelperson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-04-2013, 04:56 PM
  5. how to bring all vlookup returns even with duplicate vlookup search keys
    By NYC4LIFE in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-06-2013, 04:53 PM
  6. vlookup? match? index? MULTIPLE criteria for vlookup search problem....
    By aborg88 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-11-2013, 09:56 AM
  7. Replies: 5
    Last Post: 07-29-2009, 07:53 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