+ Reply to Thread
Results 1 to 11 of 11

comparing columns from 2 Sheets

  1. #1
    Registered User
    Join Date
    06-24-2010
    Location
    Battle Creek, MI
    MS-Off Ver
    Excel 2007
    Posts
    84

    comparing columns from 2 Sheets

    I have a spreadsheet with multiple sheets, each containing lists (columns) of employee numbers and corresponding deduction amounts. How can I 'join'/link the two sheets together in order to compare corresponding deduction amounts?

    Thanks, Dan
    Last edited by DJBittner; 06-24-2010 at 05:08 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: comparing columns from 2 Sheets

    You can use Vlookup or Sumif to gather the relevant information in one sheet (in adjacent columns). Then easily compary....
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    06-24-2010
    Location
    Battle Creek, MI
    MS-Off Ver
    Excel 2007
    Posts
    84

    Re: comparing columns from 2 Sheets

    so, i used the formula
    =VLOOKUP('icma match.xlsx'!emp_four, 'icma match.xlsx'!emp, 'icma match.xlsx'!DIFF,FALSE)
    where emp_four is my column name of employee#s to search, emp is my column name from a different sheet contain the search table and DIFF is the amount I am trying to retrieve upon a successful lookup .... i am getting #VALUE! for my result .... when i evaluate the expression all parts look good (to me) .... any thoughts?

  4. #4
    Forum Contributor day92's Avatar
    Join Date
    04-20-2010
    Location
    Los Angeles
    MS-Off Ver
    Excel 360
    Posts
    600

    Re: comparing columns from 2 Sheets

    Upload the worksheet you are working on so we can see the error. Just make sure there is no confidential information in there.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: comparing columns from 2 Sheets

    What is icma match.xlsx? Another workbook?

    Vlookup syntax is:

    =Vlookup(Lookup_Value,Lookup_Range, ColumnNumber, RangeLookup)

    where Lookup_Value is the actual thing you want to find in the first column of Lookup_Range (a table), and ColumnNumber is the column number within the range that contains the results you want returned... RangeLookup is optional and usually to find an exact match you would enter FALSE.

    See help files for this function.

  6. #6
    Registered User
    Join Date
    06-24-2010
    Location
    Battle Creek, MI
    MS-Off Ver
    Excel 2007
    Posts
    84

    Re: comparing columns from 2 Sheets

    the evaluation steps look as follows:
    VLOOKUP(emp_four, emp, DIFF,FALSE)
    VLOOKUP(11373,emp,DIFF,FALSE)
    VLOOKUP(11373,Sheet1!$A:$A,DIFF,FALSE)
    VLOOKUP(11373,Sheet1!$A:$A,Sheet1!$I:$I,FALSE)
    #VALUE!

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: comparing columns from 2 Sheets

    Maybe then:

    =INDEX(DIFF,MATCH(emp_four,emp,0))

    or

    =SUMIF(emp,emp_four,DIFF) if you are returning a single number from column I

  8. #8
    Registered User
    Join Date
    06-24-2010
    Location
    Marysville, Ohio
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: comparing columns from 2 Sheets

    VLOOKUP(11373,Sheet1!$A:$A,Sheet1!$I:$I,FALSE)
    Should be
    VLOOKUP(11373,Sheet1!$A:$I,9,FALSE)
    Look up the value 11373 in the first column (A) of the range A:all rows through I:all rows and return the value in column number 9 of the range (Column I)

  9. #9
    Registered User
    Join Date
    06-24-2010
    Location
    Battle Creek, MI
    MS-Off Ver
    Excel 2007
    Posts
    84

    Re: comparing columns from 2 Sheets

    'icma match' is the entire workbook that contain the sheets i am using; when i reference a field from a sheet such as Sheet1!emp_four, the formula gets changed from 'Sheet1'! to 'icma match.xlsx'! .... i have been working with colum I in Sheet 4 and referencing Sheet 1 .....
    Attached Files Attached Files

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: comparing columns from 2 Sheets

    See my above 2 options

    =SUMIF(emp,emp_four,DIFF)

    and then you can hide 0's by formatting as: 0;-0;;@

    or

    =IF(ISNUMBER(MATCH(emp_four,emp,0)),INDEX(DIFF,MATCH(emp_four,emp,0)),"")

  11. #11
    Registered User
    Join Date
    06-24-2010
    Location
    Battle Creek, MI
    MS-Off Ver
    Excel 2007
    Posts
    84

    Re: comparing columns from 2 Sheets

    =INDEX(DIFF,MATCH(emp_four,emp,0)) is the answer .... thanks for 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