Solved

If statement and Currency Exchange Rates

Posted on 2016-08-26
5
65 Views
Last Modified: 2016-08-27
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
Comment
Question by:pdvsa
  • 3
  • 2
5 Comments
 
LVL 29

Expert Comment

by:Subodh Tiwari (Neeraj)
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,"")))))

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

0
 

Author Comment

by:pdvsa
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 29

Accepted Solution

by:
Subodh Tiwari (Neeraj) earned 500 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)

Open in new window

0
 

Author Closing Comment

by:pdvsa
ID: 41772839
I needed False.  Thank you very much!
0
 
LVL 29

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41772840
You're welcome. Glad to help.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
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…
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.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question