Step 1 - highlight all of the data in the first two columns (don't include the headings, and it's a good idea to continue beyond the bottom of the available data in case you add more data later).
Step 2 - assign a name to the selected area. Easiest way is to type it into the "Name Box" field (usually to the left of the formula bar) or right-click and choose "Define N
ame"
In my example I highlighted cells A2 to B21 and gave it the name "Rates"
Step 3 - look up the interest rate that was effective for each of the dates in the second set of data (In my case the 2nd set of dates is in Column D):
LOOKUP(D2,Rates)
, but wrapping it into an
IF
function based on the "Charge Code".
=IF(E2="INTEREST",LOOKUP(D2,Rates),"")
Step 4 - drag that formula down the full list of items so that the row numbers are automatically altered by Excel.
These were my results:
Date Rate of Interest Date Charge Code Interest Rate
02/01/2014 1.1 27/05/2015 INTEREST 1.4
20/03/2014 1.2 10/05/2015 INTEREST 1.4
20/05/2014 1.3 12/04/2015 AUDIT FEE
20/10/2014 1.3 30/03/2015 LEGAL FEE
10/01/2015 1.4 20/02/2015 COLLECTION
13/06/2015 1.5 10/01/2015 COLLECTION
20/11/2015 1.6 20/12/2014 COLLECTION
20/12/2015 1.7 20/08/2014 COLLECTION
21/12/2015 1.8 11/07/2014 INTEREST 1.3
22/12/2015 1.9 30/06/2014 INTEREST 1.3
22/12/2015 2 04/05/2014 COLLECTION
23/12/2015 2.1 12/04/2014 COLLECTION
24/12/2015 2.2 12/04/2014 COLLECTION
25/12/2015 2.3 20/03/2014 COLLECTION
26/12/2015 2.4 10/02/2014 COLLECTION
27/12/2015 2.5 02/01/2014 COLLECTION
30/12/2015 2.6 02/01/2014 ADVANCE