+ Reply to Thread
Results 1 to 4 of 4

Compare two worksheet & insert

  1. #1
    Registered User
    Join Date
    03-14-2012
    Location
    Nairobi
    MS-Off Ver
    Excel 2007
    Posts
    2

    Smile Compare two worksheet & insert

    Dear ALL,

    I have Excel 2007 worksheet, It has Four column CUST_ID, BLANK, CUST_ID2, EMAIL_ADDRESS

    i want to compare CUST_ID & CUST_ID2, it should find the common records in CUST_ID & insert EMAIL_ADDRESS to respective common CUST_ID in BLANK column. please find attached file for more info.

    I sincerely appreciate your help.


    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Compare two worksheet & insert

    try this in B2:

    =IFERROR(VLOOKUP($A2,$C$2:$D$11,2,FALSE),"")

  3. #3
    Registered User
    Join Date
    03-14-2012
    Location
    Nairobi
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Compare two worksheet & insert

    Dear icestationzbra,


    It worked like Magic, Thank You soooooo much. Please let me know if i can do anything for you.

    Can you do one more favour,, can you please explain me how does =IFERROR(VLOOKUP($A2,$C$2:$D$11,2,FALSE),"") work ?

    Thanks again,

    Mukund

  4. #4
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Compare two worksheet & insert

    if you want to do something for me, i would say go ahead and figure out how this formula works (because that is how you will see for yourself how interesting learning Excel can be!!!).

    here is how to figure out how a formula works:

    in Excel 2007, select the cell where you have entered this formula. go to the Formulas tab and go to the Formula Auditing group of functions. select the function called Evaluate Formula and follow the prompts that you see (such as Evaluate, Step In etc.).

    but for starters, i will explain to you how this formula works. the formula has two portions - one that tries to fetch a value and the other than catches errors.

    VLOOKUP($A2,$C$2:$D$11,2,FALSE): this stands for Vertical Lookup and it takes 4 arguments. in this case, it takes the value in A2, looks that value up vertically along a (the first) column in another table which is designated by C2:D11. once it finds a (the first) matching value, it slides across the row to the second (2) column and fetches that value. now, there are certain stipulations with VLOOKUP - the value being looked up (A2) should be found in the first (left-most) column of the designated table (C2:D11), and the table should be sort in ascending order etc. FALSE basically tells VLOOKUP to find an exact match (versus TRUE which would get you an approximate match).

    now to the second part - IFERROR. let us say you have a value in A2 for which there is no match in the designated table C2:D11, the VLOOKUP formula would return an ugly error - #N/A. what IFERROR does is that it suppresses the error and displays a "" (blank) instead. now, this is not always a good idea to use because you would not know if the error is legitimate or not and figure out how to fix it. so, it is better to use this only after thoroughly testing any formula without it first.

    when you start entering =VLOOKUP (or any other excel function) in a cell, it should display to you the description of the function. once you are done looking at the description, open a parenthesis '(' and then hit CTRL+A, which will show you the arguments of that function in a descriptive and helpful way. you can also click on Help On This Function link at that point in time.

    if you problem has been solved, please set the thread to SOLVED by editing your original post and setting the prefix to SOLVED.

    welcome to excel, that which is a journey and not a destination, and where i hope the journey takes you to places that will warm the cockles of your heart!
    Last edited by icestationzbra; 03-15-2012 at 11:48 AM.

+ 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