IF Statement combined with vlookup and formula

dc4000

New Member
Joined
Jan 19, 2018
Messages
8
Hello,

This should be straightforward but ive drawn a blank.

We are given;

Sheet1:
Col B: range of currencies in this format. A sample list has been provided but there may be more so the formula has to be dynamic enough to allow for this.
Col C: Value is given but could be any given value
Col D: Requires formula to show the following. Depending on value from Col b then take this rate which can be sourced from Sheet2 and times the value in Col C by this amount. Rates need to be sourced for A1 = 30/09/2018

Sheet1
CcyValueValue_Fx'd
GBP1000
GBP2000
GBP3000
USD4000
JPY5000
DKK6000
SEK7000
BRL8000
GBP9000
EUR10000
HKD11000

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

<tbody>
</tbody>

Sheet2
FX_Rates
USDJPYUSDGBPUSDHKDUSDEURUSDSEKUSDDKKUSDBRL
31/08/2018110.050.575141.056.58.552.25
30/09/2018112.050.675151.157.59.553.25

<colgroup><col><col span="7"></colgroup><tbody>
</tbody>

<tbody>
</tbody>
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Like this?

=IF(B2="USD",C2,INDEX(Sheet2!$B$2:$H$3,MATCH($A$1,Sheet2!$A$2:$A$3,0),MATCH("USD"&B2,Sheet2!$B$1:$H$1,0))*C2)

*Assuming Sheet2 has the headers in row 1 and dates in column A
 
Last edited:
Upvote 0
On sheet1 with the following result as only the column with "USD" gave the required result. However what about the other currencies as these are not populating. The tables below are like-for-like as how the data is displayed. A1 = A1 of the excel worksheet


A1CcyValueValue Fx'd
GBP1000#N/A
=IF(B2="USD",C2,INDEX(Sheet2!$B$2:$H$4,MATCH($B$2,Sheet2!$A$2:$A$3,0),MATCH("USD"&B2,Sheet2!$B$2:$H$2,0))*C2)
GBP1000#N/A
=IF(B2="USD",C2,INDEX(Sheet2!$B$2:$H$4,MATCH($B$2,Sheet2!$A$2:$A$3,0),MATCH("USD"&B2,Sheet2!$B$2:$H$2,0))*C2)
GBP1000#N/A
=IF(B2="USD",C2,INDEX(Sheet2!$B$2:$H$4,MATCH($B$2,Sheet2!$A$2:$A$3,0),MATCH("USD"&B2,Sheet2!$B$2:$H$2,0))*C2)
USD10001000 (USING FORMULA BELOW)
JPY1000#N/A
=IF(B2="USD",C2,INDEX(Sheet2!$B$2:$H$4,MATCH($B$2,Sheet2!$A$2:$A$3,0),MATCH("USD"&B2,Sheet2!$B$2:$H$2,0))*C2)
DKK1000#N/A
=IF(B2="USD",C2,INDEX(Sheet2!$B$2:$H$4,MATCH($B$2,Sheet2!$A$2:$A$3,0),MATCH("USD"&B2,Sheet2!$B$2:$H$2,0))*C2)
SEK100#N/A
=IF(B2="USD",C2,INDEX(Sheet2!$B$2:$H$4,MATCH($B$2,Sheet2!$A$2:$A$3,0),MATCH("USD"&B2,Sheet2!$B$2:$H$2,0))*C2)
BRL1000#N/A
=IF(B2="USD",C2,INDEX(Sheet2!$B$2:$H$4,MATCH($B$2,Sheet2!$A$2:$A$3,0),MATCH("USD"&B2,Sheet2!$B$2:$H$2,0))*C2)

<tbody>
</tbody>


Sheet2
A1Fx_RATES
USDJPYUSDGBPUSDHKDUSDEURUSDSEKUSDDKKUSDBRL
31/08/2018
30/09/2018112.05.675151.157.59.553.25

<tbody>
</tbody>
 
Upvote 0
Much the same formula


Excel 2013/2016
BCD
1CcyValueValue_Fx'd
2GBP1000675
3GBP20001350
4GBP30002025
5USD40004000
6JPY5000560250
7DKK600057300
8SEK700052500
9BRL800026000
10GBP90006075
11EUR1000011500
12HKD11000165000
Sheet1
Cell Formulas
RangeFormula
D2=IFERROR(INDEX(Sheet2!B$1:H$3,MATCH(Sheet2!A$1,Sheet2!A$2:A$3,0)+1,MATCH("USD"&B2,Sheet2!B$1:H$1,0))*C2,C2)




Excel 2013/2016
ABCDEFGH
130/09/2018USDJPYUSDGBPUSDHKDUSDEURUSDSEKUSDDKKUSDBRL
231/08/2018110.050.575141.056.58.552.25
330/09/2018112.050.675151.157.59.553.25
Sheet2
 
Upvote 0
Translated with that extra row:

=IF(B2="USD",C2,INDEX(Sheet2!$B$3:$H$4,MATCH($A$1,Sheet2!$A$3:$A$4,0),MATCH("USD"&B2,Sheet2!$B$2:$H$2,0))*C2)

Or Fluff's:

=IFERROR(INDEX(Sheet2!$B$3:$H$4,MATCH($A$1,Sheet2!$A$3:$A$4,0),MATCH("USD"&B2,Sheet2!$B$2:$H$2,0))*C2,C2)
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

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