+ Reply to Thread
Results 1 to 4 of 4

Comparing two excel files to fill a cell if there is a match

  1. #1
    Registered User
    Join Date
    07-26-2012
    Location
    LA
    MS-Off Ver
    Excel 2010
    Posts
    17

    Comparing two excel files to fill a cell if there is a match

    Hello,

    I'm trying to compare two cells from two different worksheets, if they are the same, I'd like to fill a cell with data from another cell in file A to a cell in file b. I believe this is a conditional formula, but I don't have any experience with putting a conditional formula together.

    If Company name (sheet one) equals Company name A (sheet two),
    then Zip (sheet two, which is empty) equals Zip (sheet one).

    Thanks for the help in advance!

    I've attached a file with sample data on sheet 1 and sheet 2.
    Attached Files Attached Files

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Comparing two excel files to fill a cell if there is a match

    hi greenmat, try this formula in Sheet2 Cell B2:
    =IF(ISNA(VLOOKUP(A2,Sheet1!$A$2:$B$28,2,0)),"",VLOOKUP(A2,Sheet1!$A$2:$B$28,2,0))

    if i cant find it, it will be shown as blank. otherwise, the ZIP code will show. is this what you need?

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Comparing two excel files to fill a cell if there is a match

    or, seeing as the OP is using 2010....

    =IFerror(VLOOKUP(A2,Sheet1!$A$2:$B$28,2,0)),"")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    07-26-2012
    Location
    LA
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Comparing two excel files to fill a cell if there is a match

    Thanks! It worked! Very much appreciate the help!

+ 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