Hi all,
Huge thanks in advance for anyone who spends any time on this. I have been a spectator of this forum for quite sometime and have been helped out immensely by people's queries and solutions... This is my first time actually posting so I hope my query (and potential solution) is helpful to someone else! Here goes...
I am trying to match data from two spreadsheet sources based on two common criteria. To put the problem into context, I am trying to allocate our company cars fuel bills to the appropriate division/job number. The sorted incoming data consists of:
Spreadsheet 1 (S1) from Fuel Provider: Column A - Car Registration # ; Column B - Date of Fuel Purchase ; Column C - Cost of Fuel.
Spreadsheet 2 (S2) from our company resource allocation schedule: Column A - Car Registration # ; Column B - Allocation Start Date ; Column C - Allocation End Date ; Column D - Job/Division Number.
So, if the car registrations in the two Column As match, and the date of the purchase (S1:Column B) falls between the dates in S2:Columns B and C, I need to return the Job/Division number to S1 so that the cost in S1:Column C can be charged to the right account.
The logic seemed simple enough to me at first, but having tried numerous combinations of VLOOKUP and IFs in arrays and a couple of INDEX, MATCH combos (although I'd be the first to admit I'm a complete novice with the latter functions), I always come back to the same problems... 1) VLOOKUP will only return a single match for the Car Registration when in fact there instances of multiple results (since one car may work on 2 or more jobs simultaneously); 2) I can't seem to get the IF function to work properly in an array, in order to scan the Job allocation periods to match the right purchase date.
I've been in awe of some of the neat tricks posted on here in the past, so I've every confidence someone out there has a solution!
With thanks for your valuable time,
Andrew
Huge thanks in advance for anyone who spends any time on this. I have been a spectator of this forum for quite sometime and have been helped out immensely by people's queries and solutions... This is my first time actually posting so I hope my query (and potential solution) is helpful to someone else! Here goes...
I am trying to match data from two spreadsheet sources based on two common criteria. To put the problem into context, I am trying to allocate our company cars fuel bills to the appropriate division/job number. The sorted incoming data consists of:
Spreadsheet 1 (S1) from Fuel Provider: Column A - Car Registration # ; Column B - Date of Fuel Purchase ; Column C - Cost of Fuel.
Spreadsheet 2 (S2) from our company resource allocation schedule: Column A - Car Registration # ; Column B - Allocation Start Date ; Column C - Allocation End Date ; Column D - Job/Division Number.
So, if the car registrations in the two Column As match, and the date of the purchase (S1:Column B) falls between the dates in S2:Columns B and C, I need to return the Job/Division number to S1 so that the cost in S1:Column C can be charged to the right account.
The logic seemed simple enough to me at first, but having tried numerous combinations of VLOOKUP and IFs in arrays and a couple of INDEX, MATCH combos (although I'd be the first to admit I'm a complete novice with the latter functions), I always come back to the same problems... 1) VLOOKUP will only return a single match for the Car Registration when in fact there instances of multiple results (since one car may work on 2 or more jobs simultaneously); 2) I can't seem to get the IF function to work properly in an array, in order to scan the Job allocation periods to match the right purchase date.
I've been in awe of some of the neat tricks posted on here in the past, so I've every confidence someone out there has a solution!
With thanks for your valuable time,
Andrew