Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# If statement and Currency Exchange Rates

Posted on 2016-08-26
Medium Priority
101 Views
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
0
Question by:pdvsa
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 3
• 2

LVL 32

Expert Comment

ID: 41772679
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,"")))))
``````

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)
``````
0

Author Comment

ID: 41772687
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
0

LVL 32

Accepted Solution

Subodh Tiwari (Neeraj) earned 2000 total points
ID: 41772689
You are using the approximate range lookup in Vlookup formula, so that might be a cause.
You may try the exact match with the following formula....

``````VLOOKUP(X6,ExchangeRates_tony,2,FALSE)
``````
0

Author Closing Comment

ID: 41772839
I needed False.  Thank you very much!
0

LVL 32

Expert Comment

ID: 41772840
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
###### Suggested Courses
Course of the Month10 days, 3 hours left to enroll