+ Reply to Thread
Results 1 to 8 of 8

Comparing 2 spreadsheets - to get data on 1

  1. #1
    Registered User
    Join Date
    08-15-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    13

    Comparing 2 spreadsheets - to get data on 1

    Hello,

    I am hoping someone can help, I need to compare to 2 spread sheets and then produce a date found on one spread sheet if the 2 items match.
    For example - Spread sheet one is a data dump and spread sheet 2 is an invoice.
    If the employee number on spread sheet 2 matches spread sheet 1 then I need the dates and hours from spread sheet 1 to be shown in multiple cells on spread sheet 2.
    I have tried VLOOK ups, but must admit I don't fully understand them (yet), so any assistance or tips would be greatly appreciated.

    I hope this makes sense?
    Thanks

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Comparing 2 spreadsheets - to get data on 1

    In order for VLOOKUP to work, your column that holds the employee number in spread sheet 1 must be on the left of the column that holds the dates and hours.

    You didn't post a sample workbook so it's a little hard to visualize. Here is something you can try.

    Let's say your employee number column is column A on both worksheets, and in spread sheet 1, the dates and hours are in column B

    In cell B2 of spread sheet 2, enter this formula
    Please Login or Register  to view this content.
    Change NameOfSpreadSheet1 to the exact name of your spread sheet 1, if it contains spaces, cover the name with single quotes, like this: 'Name of Sheet 1'

    if your dates/hours column are further away, let's say column G, you would change A:B to A:G, and then 2 to 7. This number represents the Nth column of the range (in this case A:G) you want the value returned from.

  3. #3
    Registered User
    Join Date
    08-15-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Comparing 2 spreadsheets - to get data on 1

    Thanks Heaps, but I think I should have given more details. So i have attached an example spread sheet. On the invoice I need to show all days (on separate lines) from the data dump sheet, for the employee that matched cell C22 on the invoice tab.
    Attached Files Attached Files

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,462

    Re: Comparing 2 spreadsheets - to get data on 1

    Quote Originally Posted by millz View Post
    In order for VLOOKUP to work, your column that holds the employee number in spread sheet 1 must be on the left of the column that holds the dates and hours.
    It is actually possible to use VLOOKUP when the lookup column is on the right side of the data to be picked
    Please Login or Register  to view this content.
    where col D is the LOOKUP column and col B contains values to be looked up

  5. #5
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Comparing 2 spreadsheets - to get data on 1

    Quote Originally Posted by Sarah Christian View Post
    Thanks Heaps, but I think I should have given more details. So i have attached an example spread sheet. On the invoice I need to show all days (on separate lines) from the data dump sheet, for the employee that matched cell C22 on the invoice tab.
    Well, yes you should have done so, because it now seems a little too complicated to be done with just formulas.

    You want to show all days on separate lines, that would also mean there will be duplicated dates (as per your data dump). Or do you take only rows with "Code" = "TRAV"? So for those lines of dates, their respective columns "Code", "Date" (duplicate?), "Hours", "Rate", "Amount" needs to be copied as well? Is my understanding correct?



    @Pepe Le Mokko
    Well, I didn't say it's not possible. In fact, in Excel's function dialog it states that Vlookup "looks for a value in the leftmost column of a table". What you shown is actually a very nice trick or workaround in cases where the lookup value is actually on the right, though what it actually does is still sort of "rearranging" columns so Excel looks on the correct leftmost column. Though I appreciate that I learnt something new from your post, it may not exactly be beneficial to OP. IMO, it's more trouble than its worth.

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,462

    Re: Comparing 2 spreadsheets - to get data on 1

    In B28 enter following array formula
    Please Login or Register  to view this content.
    and pull down until no more results appear.
    Do not forget to commit with Ctrl+Shift+Enter

  7. #7
    Registered User
    Join Date
    08-15-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Comparing 2 spreadsheets - to get data on 1

    Pepe Le Mokko, I can't seem to get a result with the formula above. I have entered it exact into B28 on the invoice sheet and I am getting a date of 00/01/1900.

  8. #8
    Registered User
    Join Date
    08-15-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Comparing 2 spreadsheets - to get data on 1

    Hi Millz,

    Yes I do want to show duplicate dates. In column B the dates will be dupliacted, but in column C the codes will be different. I will then need to show the hours, rates and amounts as well on the invoice sheet.

    Thank you so much for your help so far.

+ 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. comparing data from 2 spreadsheets
    By oscarand in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-16-2012, 02:23 PM
  2. Replies: 2
    Last Post: 01-25-2012, 05:30 AM
  3. Comparing Data on two spreadsheets?
    By k1ng in forum Excel General
    Replies: 2
    Last Post: 06-04-2008, 08:28 AM
  4. Comparing data from different spreadsheets????
    By kittymis in forum Excel General
    Replies: 1
    Last Post: 10-18-2005, 06:23 PM
  5. Comparing data and updating spreadsheets
    By mvhutton in forum Excel General
    Replies: 3
    Last Post: 07-11-2005, 04:05 PM

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