Solved

If statement and Currency Exchange Rates

Posted on 2016-08-26
5
73 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
[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
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 30

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 30

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 30

Expert Comment

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

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

740 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