+ Reply to Thread
Results 1 to 17 of 17

Multiple lookup and Dates

  1. #1
    Registered User
    Join Date
    07-21-2004
    Posts
    66

    Multiple lookup and Dates

    Hello

    I have two work sheets in the same spreadsheet.

    1) Transaction download for Fuel with, Car Reg, Transaction Date, Amount

    2) Asset Tracker with, Car Reg, Employee Code, Date Owned From, Date owned To.
    (The Car can have been owned by more than one Employee but not at the same time)

    I want to allocate the Employee Code to each Transaction on the Transaction worksheet for the relevent dates.

    Can you help?

    Thanks

    Robo

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Quote Originally Posted by Robo
    Hello

    I have two work sheets in the same spreadsheet.

    1) Transaction download for Fuel with, Car Reg, Transaction Date, Amount

    2) Asset Tracker with, Car Reg, Employee Code, Date Owned From, Date owned To.
    (The Car can have been owned by more than one Employee but not at the same time)

    I want to allocate the Employee Code to each Transaction on the Transaction worksheet for the relevent dates.

    Can you help?

    Thanks

    Robo
    The only common data seems to be the Car Reg. But can there be different employee codes for the same Car Reg?

  3. #3
    Registered User
    Join Date
    07-21-2004
    Posts
    66

    Reply

    Yes there can, a car can be owned by different employees, but not at the same time. This info is on the Asset Tracker worksheet.

    Hope that helps!!

    Robo

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Quote Originally Posted by Robo
    Yes there can, a car can be owned by different employees, but not at the same time. This info is on the Asset Tracker worksheet.

    Hope that helps!!

    Robo
    And is there a relation between the transaction date and Date owned from and date owned to?

  5. #5
    Registered User
    Join Date
    07-21-2004
    Posts
    66
    Yes.

    The lookup will be the Car Reg on the Transaction worksheet.

    The Asset Tracker worksheet has the Car Reg, The Employee Code, Date Owned From, Date Owned To.

    I want to put an Employee Code on each transaction on the Transaction Worksheet. This is easy if the car was owned by just one employee. However, a car can have two or three owners. Therefore the transaction date would have to fall between the dates owned by an employee to allocate the correct Employee Code.

    Thanks for your help.

    Robo

  6. #6
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    It seems you have a Many-to-many relationship which will not allow to do what you are after.
    Sorry to say ( or I'm awfully mistaken) that this is due to bad database design.
    Anyway, if you can post a sample, maybe something can be done.

  7. #7
    Registered User
    Join Date
    07-21-2004
    Posts
    66
    I have attached a example for you.

    Many Thanks

    Robp
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    I'm afraid I couldn't find a solution.
    I strongly suggest you review the design of your database and normalize it as much as possible.
    Using a Vlookup it is quite simple to allocate the employee codes were the combination Car Reg - Employee Code is unique ( in Asset Tracker).
    But multiple employees with multiple Car Regs
    If somebody finds a solution to this one I will be very interested

  9. #9
    Registered User
    Join Date
    07-21-2004
    Posts
    66
    There's a challenge!!

    Thanks anyway

    Robo

  10. #10
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    Is the attached what you needed ...?

    HTH
    Carim
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    07-21-2004
    Posts
    66
    The attached file is what I need. No solution as yet. I'm sure there is?

    Thanks for any help.

  12. #12
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi again,

    I have attached in my previous post an array formula which brings back the employee code ... (file name is lookupdates.xls)
    Is it what you needed ... ?

    HTH
    Carim

  13. #13
    Registered User
    Join Date
    07-21-2004
    Posts
    66
    Fantastic!! Very impressed!!

    Thanks for your help. Its been driving me mad all day!

    Robo

  14. #14
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Glad it fixed your problem ...

    Be careful in column B of transactions, there are some blanks which prevent proper matching with asset tracker ...
    and asset tracker does not have all the dates, especially for GH02ZBZ and for
    RB02SBZ ...

    Thanks for the feedback
    Carim

  15. #15
    Registered User
    Join Date
    07-21-2004
    Posts
    66
    Yes, I also spotted the blanks.

  16. #16
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    Forgot to mention that there are also some input dates which are not formatted properly, which prevents the array formula from returning the employee code ...

    HTH
    Carim

  17. #17
    Registered User
    Join Date
    07-21-2004
    Posts
    66
    Also spotted those.
    Thanks

+ 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