Date and currency look up

PM1

Board Regular
Joined
Oct 28, 2005
Messages
192
I tried to tackle this a few months ago and had to drop it as I didnt have Excel Jeanie, now I have :)

I need to look up a Currency in a table and return the value at the date the entry was made.

So this table is a record of all purchases:-

Excel Workbook
ABCDEFGHIJK
1PO DateBudget YrLPO NoDescriptionSupplierQtyLocal CurrUnit Cost Local CurencyExt Cost Local CurrencyExt Cost EuroExt Cost USD
2143Jan-1420142439Wooden Cabinets & Shelves 3rd FloorJapan Construction & Trading1BHD985.00985.0002,159.0182,612.628
2144Jan-1420142439Demolition of walls between Vault Room & CorridorJapan Construction & Trading1BHD190.00190.000416.460503.959
2145Jan-1420142439Refixing of Ceiling & FlooringJapan Construction & Trading1BHD85.0085.000186.311225.455
2146Jan-1420142440Daily Pre Paid Package for BCP Testing at BNPP DOHAProgresssoft2USD1,500.003,000.0002,479.1343,000.000
2147Jan-1420142441Miocrosoft Wireless 3000 KeyboardHBC Printer Supplies Llc2AED240.00480.000107.992130.682
2148Jan-1420142442Maintenance of FileNet ScannersCad Gulf Llc1AED54,500.0054,500.00012,261.63514,837.805
2149Jan-1420142443Maintenance Contract for Etrali Bahrain - Jan 1 - Dec 31ETRALI1EUR23,170.0023,170.00023,170.00028,038.017
2150Jan-1420142443Maintenance Contract for Etrali Dubai - Jan 1 - Dec 31ETRALI1EUR10,377.0010,377.00010,377.00012,557.208
2151Jan-1420142444KVM Cables Cat5 KVM USBHewlett Packard (HP)5ZAR994.364,971.800355.214429.845
2152Jan-1420142445Dry Contact for Touch PanelCotton House for Quilts5BHD125.00625.0001,369.9361,657.759
2153Jan-14201424465M LC-LC Multimode CablePeripherals And Parts Trading Llc30AED45.001,350.000303.729367.542
LPO Master Data


This is my currency table for 2014

Excel Workbook
ABCDEFGHIJKLMNO
4CodeDescriptionAverageJanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember
6AEDDIRHAM DES E.A.U.4.8515608774.953591475.077187915.059993695.095116255.007700045.029165054.917479354.824183884.638011864.601534414.570008824.44475781
23BHDDINAR DE BAHREIN0.4979963740.508468020.521154750.519375870.523009080.514022250.516280870.504740990.495178070.47607560.472324390.469100730.456225854
36CHFFRANC SUISSE1.2124985951.22457421.213659411.217867291.220389211.220311181.214124091.217170031.206128061.205847731.205945291.201399531.202567135
57EUREURO1111111111111
62GBPLIVRE STERLING0.8023864480.820696170.824859780.826320390.821435990.813314680.800432580.792940070.792924420.779361850.78341620.79610970.776825553
93KWDDINAR DU KOWEIT0.3763078490.381391480.389055250.387897740.389893380.384253850.385766050.378940650.373879020.364046310.363362120.362721630.354486699
105MADDIRHAM DU MAROC11.1545453211.199055111.262842911.243972711.253522811.219692811.234696511.192101211.14997911.066548311.037669611.013410110.98105295
137QARRIYAL DU QUATAR4.8095074244.9111095.033714585.016392685.050587154.96277614.98507364.874570824.78235214.598486254.562133874.530132254.40676069
143SARRIYAL D'ARABIE SAOUDITE4.9546129115.058044415.184108815.166482175.202624255.113499885.135559665.021102474.925841044.737394234.700192424.669544844.54096078
171USDDOLLAR US1.3208791671.348651.38231.37761.38721.36341.36931.33881.31341.26281.25281.24421.2101
191ZARRAND COMMERCIAL AFRIQUE DU SUD14.3513111115.063476714.850049414.500618214.594741214.43404414.556686214.338548313.999136814.274439113.8478252513.7595460713.9966221
Sheet2


I need to look up the currency code in the PO File, find it in the currency file then look at the date in the LPO file and ensure that the conversion is in that date period.

I convert Local to Euro then Euro to USD
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Here's an example that you may be able to adapt (formula in C2 copied down):


Excel 2010
ABCDEFGHIJKLMNOPQRS
1PO DateLocal CurrRateCodeDescriptionAverage01/01/201401/02/201401/03/201401/04/201401/05/201401/06/201401/07/201401/08/201401/09/201401/10/201401/11/201401/12/2014
201/01/2014BHD0.50846802AEDDIRHAM DES E.A.U.4.8515608774.953591475.077187915.059993695.095116255.007700045.029165054.917479354.824183884.638011864.601534414.570008824.44475781
301/02/2014CHF1.21365941BHDDINAR DE BAHREIN0.4979963740.508468020.521154750.519375870.523009080.514022250.516280870.504740990.495178070.47607560.472324390.469100730.456225854
401/03/2014AED5.05999369CHFFRANC SUISSE1.2124985951.22457421.213659411.217867291.220389211.220311181.214124091.217170031.206128061.205847731.205945291.201399531.202567135
Sheet1
Cell Formulas
RangeFormula
C2=INDEX(H$2:S$4,MATCH(B2,E$2:E$4,FALSE),MATCH(A2,H$1:S$1,FALSE))
 
Upvote 0
Thanks for this,

One query I have is that the dates in the PO File that I have are not fixed to the first of each month. I need to keep the PO date and lookup the month month and year in the Currency Table as this will grown when I add 2015 rates into the table month by month and so on.
 
Upvote 0
Here's another example:


Excel 2010
ABCDEFGHIJKLMNOPQRS
1PO DateLocal CurrRateCodeDescriptionAverageJanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember
204/01/2014BHD0.50846802AEDDIRHAM DES E.A.U.4.8515608774.953591475.077187915.059993695.095116255.007700045.029165054.917479354.824183884.638011864.601534414.570008824.44475781
316/02/2014CHF1.21365941BHDDINAR DE BAHREIN0.4979963740.508468020.521154750.519375870.523009080.514022250.516280870.504740990.495178070.47607560.472324390.469100730.456225854
421/03/2014AED5.05999369CHFFRANC SUISSE1.2124985951.22457421.213659411.217867291.220389211.220311181.214124091.217170031.206128061.205847731.205945291.201399531.202567135
Sheet1
Cell Formulas
RangeFormula
C2=INDEX(H$2:S$4,MATCH(B2,E$2:E$4,FALSE),MATCH(TEXT(A2,"mmmm"),H$1:S$1,FALSE))
 
Upvote 0
A2 is a date field so is H1:S1, so could I use Month instead?, tried but failed

INDEX(H$2:S$4,MATCH(B2,E$2:E$4,FALSE),MATCH(month(A2),H$1:S$1,FALSE))
 
Upvote 0
Entered as 01/01/201? then cell formatted to MMM/YR to show:-

Jan 13, Jan 14, Feb 14, etc
 
Upvote 0
Andrew, That worked great.

I added a little to Invert the rates and arrive at a local cost thus:-

=IF(ISNA(1/INDEX('Conv Rates'!$C$5:$AA$195,MATCH($G2,'Conv Rates'!$A$5:$A$195,FALSE),MATCH(DATE(YEAR($A2),MONTH($A2),1),'Conv Rates'!$C$4:$AA$4,FALSE))*$I2),0,1/INDEX('Conv Rates'!$C$5:$AA$195,MATCH($G2,'Conv Rates'!$A$5:$A$195,FALSE),MATCH(DATE(YEAR($A2),MONTH($A2),1),'Conv Rates'!$C$4:$AA$4,FALSE))*$I2)

Thanks again for your help and quick response, so glad to have experts like you avaialable.
 
Upvote 0
If you have Excel 2007 or above you can use IFERROR rather than IF(ISNA:

=IFERROR(1/INDEX('Conv Rates'!$C$5:$AA$195,MATCH($G2,'Conv Rates'!$A$5:$A$195,FALSE),MATCH(DATE(YEAR($A2),MONTH($A2),1),'Conv Rates'!$C$4:$AA$4,FALSE))*$I2,0)
 
Upvote 0

Forum statistics

Threads
1,215,076
Messages
6,122,987
Members
449,093
Latest member
Mr Hughes

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