+ Reply to Thread
Results 1 to 25 of 25

Using a VLOOKUP to comapre data across 2 worksheets

  1. #1
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Using a VLOOKUP to comapre data across 2 worksheets

    Morning,

    How can i use a vlookup to check 2 sheets of data to make sure a reference exists in both lists, and bring back that reference into a template?

  2. #2
    Forum Contributor Russell Dawson's Avatar
    Join Date
    03-01-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2007
    Posts
    608

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    Hi

    Your question is rather vague - check out the rules.

    This may help.

    http://office.microsoft.com/en-us/ex...005209335.aspx
    If I helped, please don't forget to add to my reputation. (click on the star below the post)

    If the problem is solved, please: Select Thread Tools (on top of your 1st post) -> Mark this thread as Solved.

    Failure is not falling down but refusing to get up.

  3. #3
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    Hi,

    My apologies.

    I have 2 sources of data, i need to check both columns of data to make sure a reference number is aparant in both lists. (like checking one list against the other)

    Not sure if it was something like =VLOOKUP(list1A1:A300,List2A1:300,1,1,0)

  4. #4
    Forum Contributor Russell Dawson's Avatar
    Join Date
    03-01-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2007
    Posts
    608

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    Hi - it's really going to be a help if you could upload a sample of your worksheet

  5. #5
    Registered User
    Join Date
    08-09-2010
    Location
    Midlands
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    A non VBA way of doing this would be to use the ISNA and and function
    Please Login or Register  to view this content.
    VBA would require a user-defined function which I'm not particularly great with but the above should give you what you're after.

    Maudise

  6. #6
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    Attached as requested,

    If the value in sheet 2 is in sheet 1 then that value need to be shown.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    Has this helped?

  8. #8
    Forum Contributor Russell Dawson's Avatar
    Join Date
    03-01-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2007
    Posts
    608

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    Hi

    Sorry, I thought you'd got a solution.

    Yes, in Sheet1 in B2 put

    Please Login or Register  to view this content.
    Copy down

    This will identify those matched.
    Last edited by Russell Dawson; 05-17-2012 at 10:20 AM.

  9. #9
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    Brilliant, your a star!

  10. #10
    Forum Contributor Russell Dawson's Avatar
    Join Date
    03-01-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2007
    Posts
    608

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    My pleasure. Don't forget to mark as solved and a star would be nice

  11. #11
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    Is there a way of pulling through a whole row of data once the reference has been checked rather than just that one cell!?

  12. #12
    Forum Contributor Russell Dawson's Avatar
    Join Date
    03-01-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2007
    Posts
    608

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    If you drag the formula down from B2 and that then checks each entry in Sheet1 against all entries in Sheet2 and give a result of all matches in column B. By row I assume you mean column.

  13. #13
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    Sorry i should have explained my query a bit more, apologies, using this same type of formula, can it be used in a similar way but bring through a row of data, for example if there was data in A1, B1, C1, D1.

    Can all this data be shown if the reference is on both sheets?

  14. #14
    Forum Contributor Russell Dawson's Avatar
    Join Date
    03-01-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2007
    Posts
    608

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    You can't beat reality. Please try to show the real worksheet or at least a representative sample of what you have and what you expect.

  15. #15
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    As requested.

    In the sheet attached, on sheet 1 i have the full data and on sheet 2 i have the references that i need to compare to sheet 1. The formula used matches the references then pulls the matched reference as a result.

    My question is instead of just the reference been shown, can the whole line of data be shown instead, eg cells A9,B9,C9,D9,E9
    Attached Files Attached Files

  16. #16
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    Attachment as requested, not sure if it attached above.

  17. #17
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    Can anyone help on this at all?

  18. #18
    Forum Contributor Russell Dawson's Avatar
    Join Date
    03-01-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2007
    Posts
    608

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    Hi Ken,

    Sorry, I missed your post - delayed email?

    You could have a simple entry in the columns where you expect the data from the other four columns.

    In H1 put

    Please Login or Register  to view this content.
    In I1 put

    Please Login or Register  to view this content.
    and so on. Then copy down.

    I do hope I understood you correctly.

    Regards

    Russell

  19. #19
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    Hi thanks for coming back,

    It seems to return all information for all rows, i only wanted the info for the cases that were matched on both sheets suing the VLOOKUP formula.

  20. #20
    Forum Contributor Russell Dawson's Avatar
    Join Date
    03-01-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2007
    Posts
    608

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    Sorry - didn't test it beyond filled cell. Duh!

    Use this in G1 and across and down.

    Please Login or Register  to view this content.
    I've set it so that when you copy across it will pick up relevant data. Also set absolute values to match critical columns.

  21. #21
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    Lovely, works a treat, thank you!

  22. #22
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    Following on from this, is there a macro i can use to delete all the lines that don't have the required information once the vlookup has been done?!

  23. #23
    Forum Contributor Russell Dawson's Avatar
    Join Date
    03-01-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2007
    Posts
    608

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    You could sort column G (Z-A) and then delete all below as they are clearly not matched

  24. #24
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    Lovely,

    I've now put this into production and wondered what would change if the data was all in once sheet, the formula is in column J, i can't see to adjust it to bring back the whole data rather than just the reference.
    Attached Files Attached Files

  25. #25
    Forum Contributor Russell Dawson's Avatar
    Join Date
    03-01-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2007
    Posts
    608

    Re: Using a VLOOKUP to comapre data across 2 worksheets

    The reference to column H in the formula needs to be absolute for H so in J2

    =IF(ISERROR(MATCH($H2,$A:$A,0)),"",A2)

    Then drag across and down.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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