Finding a date in a list in another array

Denis

New Member
Joined
Nov 13, 2008
Messages
12
Good afternoon,

I have a sheet that contains a list of electricity supply invoice lines (call it Data). Each row has "From" and "To" dates A second sheet contains a record of current and previous contract start and end dates and associated prices (call it Contracts). I want to look up the supply number from Data in Contracts and when found determine which of the Contracts has the correct pricing for the pair of From and To dates. I can get the formula below to work in a small test environment but when copied to my production environment it fails with #Value.

=IF(VLOOKUP($J114,contracts,1,FALSE),(LOOKUP(2,1/($K$2:$K$8<=$K114)/($L$2:$L$8>=$L114),M$2:M$8)))

Rows 1-8 below represent Contracts, the rest Data

Many thanks in advance for any help.

Denis

MPANSupplierContract StartContract EndContracted day unit charge:Contracted night unit charge:E&W/EContracted standing charge:ASC:
2000054798787BG00/01/190020/02/20149.01061.91
2000054798787BG21/02/201419/02/20159.72062.42
2000054798787EDF20/02/201530/06/20159.5614061.0964
2000054798787EDF01/07/201530/06/20169.7094048.439
2000054798787Hudson01/01/201631/12/20169.976.0984.56589041
2000054798787EDF01/07/201611/07/20169.5748046.1226
2000054798787EDF12/07/201630/06/20179.9066.08108.20954792.3499
MPANFromTODay RateNight RateE&WE RateSt ChargeASC
200005479878728/11/201317/12/20139.01000.00000.000061.91000.0000
200005479878718/12/201327/01/20149.01000.00000.000061.91000.0000
200005479878728/01/201421/02/2014#N/A#N/A#N/A#N/A#N/A
200005479878722/02/201428/02/20149.72000.00000.000062.42000.0000
200005479878701/03/201431/03/20149.72000.00000.000062.42000.0000
200005479878701/04/201423/04/20149.72000.00000.000062.42000.0000
200005479878724/04/201431/05/20149.72000.00000.000062.42000.0000
200005479878701/06/201430/06/20149.72000.00000.000062.42000.0000
200005479878701/07/201431/07/20149.72000.00000.000062.42000.0000
200005479878701/08/201419/08/20149.72000.00000.000062.42000.0000
200005479878720/08/201401/10/20149.72000.00000.000062.42000.0000
200005479878701/10/201431/10/20149.72000.00000.000062.42000.0000
200005479878701/11/201430/11/20149.72000.00000.000062.42000.0000
200005479878701/12/201431/12/20149.72000.00000.000062.42000.0000
200005479878701/01/201531/01/20159.72000.00000.000062.42000.0000

<colgroup><col><col><col span="2"><col><col span="4"></colgroup><tbody>
</tbody>
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,213,526
Messages
6,114,136
Members
448,551
Latest member
Sienna de Souza

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top