Need to convert value depending on currency and date

Ascensus

New Member
Joined
Feb 22, 2024
Messages
1
Office Version
  1. 2021
Platform
  1. Windows
I need a formula that will identify what exchange rate to use to convert E2 in to F2. The parameters are a date the B2 relates to and the currency in A2. The currencies are CHF, EUR & USD.
The first table is the data and I need to work out the value in the F1. The second table is a extract from the currency table that I want to look up to. There is a table for each currency.

I have tried a vlookup with multiple criteria but haven't had much success.

ABCDEF
1CurrencyYearPurchase DateProduct CodeCurr PriceGBP Price
2GBP200001/05/2000CH000437.00
3CHF201629/03/2016CH00053.05
4USD202404/08/2024CH000672.00
5EUR202306/09/2023CH00071.50
6GBP200901/12/2009CH00082.46


ABC
1Curr.DateRate
2USD20080.5445730
3USD20090.6411690
4USD20100.6474910
5USD20110.6236290
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
This can be achieved, but it will be necessary for your sample data to be complete for all currency conversions and years for us to provide you with a solution.
 
Upvote 0
I'm not sure I understand it correctly. However, if I do, what I would do is convert the currency tables to excel Tables and name them as their currency code (e.g., GBP, USD, EUR, CHF). You can also drop Column A then for each Currency, as there is no need for them any longer.

Then just do this in column F (assuming your main data table is also a Named Table):

VBA Code:
=XLOOKUP([@Year], INDIRECT([@Currency]&"[Date]"), INDIRECT([@Currency]&"[Rate]") , , -1) * [@[Curr Price]]
 
Upvote 0

Forum statistics

Threads
1,223,789
Messages
6,174,576
Members
452,573
Latest member
Cpiet

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