need formula for currency

zoharb

New Member
Joined
Nov 24, 2011
Messages
42
Office Version
  1. 2021
  2. 2013
Respected,.
Has tried using IF formula but is not working. Can you please give the correct one
1712974788430.png
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
You need a lookup table that lists country names and corresponding currency codes. Then use XLOOKUP or VLOOKUP depending on your version of Excel

Lookup table (this is just the beginning)

Packing Checklist.xlsm
GHI
1CountryCurrencyCode
2AfghanistanAfghaniAFN
3Åland IslandsEuroEUR
4AlbaniaLekALL
5AlgeriaAlgerian DinarDZD
6American SamoaUS DollarUSD
7AndorraEuroEUR
8AngolaKwanzaAOA
9AnguillaEast Caribbean DollarXCD
10Antigua And BarbudaEast Caribbean DollarXCD
11ArgentinaArgentine PesoARS
12ArmeniaArmenian DramAMD
13ArubaAruban FlorinAWG
14AustraliaAustralian DollarAUD
15AustriaEuroEUR
16AzerbaijanAzerbaijanian ManatAZN
17BahamasBahamian DollarBSD
Currency Rates


Results:

Packing Checklist.xlsm
KL
1CountryCurrency
2USAUSD
3CanadaCAD
Currency Rates
Cell Formulas
RangeFormula
L2L2=XLOOKUP(K2,$G:$G,$I:$I)
L3L3=VLOOKUP(K3,$G:$I,3,FALSE)
 
Upvote 0
Although I think a table is by far the better way to go...

Book1
ABCDEF
1
2UNITED STATESUSD
3CANADACAD
4UNITED STATESUSD
5UNITED KINGDOMGDP
6NEW ZEALANDNZD
Sheet6
Cell Formulas
RangeFormula
F2:F6F2=IFERROR(VLOOKUP(B2,{"CANADA","CAD";"NEW ZEALAND","NZD";"UNITED KINGDOM","GDP";"UNITED STATES","USD"},2,0),"")
 
Last edited:
Upvote 1
Although I think a table is by far the better way to go...

Book1
ABCDEF
1
2UNITED STATESUSD
3CANADACAD
4UNITED STATESUSD
5UNITED KINGDOMGDP
6NEW ZEALANDNZD
Sheet6
Cell Formulas
RangeFormula
F2:F6F2=IFERROR(VLOOKUP(B2,{"CANADA","CAD";"NEW ZEALAND","NZD";"UNITED KINGDOM","GDP";"UNITED STATES","USD"},2,0),"")
Respected Mark,
Thank you , the formula given by you worked
Can it be also made to work even if
"united states" is "unitedstates"
"new zealand" is "newzealand"
"united kingdom" is "unitedkingdom"(means not having spaces)

i tried using OR but it was not working.
PLEASE Please try from your end , if it works or some other way.
PLEASE
Zohar Batterwala
 
Upvote 0
They all need adding separately as per the others in the formula BUT if you are having that many alternatives then you seriously need to have a separate Lookup table as @6StringJazzer has posted.

Having more than 5 lookup's in the formula makes it very difficult to manage down the line

Book1
ABCDEF
1
2UNITED STATESUSD
3CANADACAD
4UNITED STATESUSD
5UNITED KINGDOMGDP
6NEW ZEALANDNZD
7UNITEDSTATESUSD
8UNITEDKINGDOMGDP
9NEWZEALANDNZD
10
Sheet1
Cell Formulas
RangeFormula
F2:F9F2=IFERROR(VLOOKUP(B2,{"CANADA","CAD";"NEW ZEALAND","NZD";"NEWZEALAND","NZD";"UNITED KINGDOM","GDP";"UNITEDKINGDOM","GDP";"UNITED STATES","USD";"UNITEDSTATES","USD"},2,0),"")
 
Upvote 1
Solution

Forum statistics

Threads
1,217,119
Messages
6,134,748
Members
449,887
Latest member
robyngknapp

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