Solved

If statement and Currency Exchange Rates

Posted on 2016-08-26
5
50 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 28

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 28

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 28

Expert Comment

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

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now