Link to home
Start Free TrialLog in
Avatar of pdvsa
pdvsaFlag for United States of America

asked on

If statement and Currency Exchange Rates

Hello Experts,

I have an error with the below:  "Too many arguments"
Do you see where I have the error?  
Any cleanup modifications are welcome.  

=IF(k6="USD",Z6,IF(K6="SAR",VLOOKUP(X6,ExchangeRates_tony,2)*Z6),IF(k6="EUR",VLOOKUP(X6,ExchangeRates_tony,2),IF(K6="GBP",VLOOKUP(X6,ExchangeRates_tony,2)*Z6),IF(K6="JPY",VLOOKUP(x6,ExchangeRates_tony,2)*Z6))

thank you
Avatar of Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj)
Flag of India image

It should be like this....

=IF(K6="USD",Z6,IF(K6="SAR",VLOOKUP(X6,ExchangeRates_tony,2)*Z6,IF(K6="EUR",VLOOKUP(X6,ExchangeRates_tony,2),IF(K6="GBP",VLOOKUP(X6,ExchangeRates_tony,2)*Z6,IF(K6="JPY",VLOOKUP(X6,ExchangeRates_tony,2)*Z6,"")))))

Open in new window


The same formula can be written as below since all your calculations are same for currencies other than USD.

=IF(K6="USD",Z6,VLOOKUP(X6,ExchangeRates_tony,2)*Z6)

Open in new window

Avatar of pdvsa

ASKER

Thank you.  I have a follow up though.  I am not getting the correct exchange rate.   Do you see anything that might cause?  I have to run outside for a bit and will be back after while.   if it matters, X6 if a vlookup itself.  

thank you
ASKER CERTIFIED SOLUTION
Avatar of Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj)
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pdvsa

ASKER

I needed False.  Thank you very much!
You're welcome. Glad to help.