ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If statement based on currency format (https://www.excelbanter.com/excel-worksheet-functions/110499-if-statement-based-currency-format.html)

juliejg1

If statement based on currency format
 
I have a spreadsheet that has a column (column B) of numbers. Some of the
numbers are formatted in Euro currency and some are formatted in USD currency.
I would like to put a formula in column C to automatically calculate the
currency conversion of the Euro to USD.

If cell B1 currency = Euro, then cell C1*1.45, else cell B1
Is there any way to do this?

excelent

If statement based on currency format
 
first put this in a cell:

=CELL("format",B2) where B2 exchange to a cell where Euro is formattet
the result from this u can use in :

put in C2 and copy down:
=IF(CELL("format",B2)=" put result from above in here ",B2*1.45,B2)


Richard Buttrey

If statement based on currency format
 
On Mon, 18 Sep 2006 11:35:02 -0700, juliejg1
wrote:

I have a spreadsheet that has a column (column B) of numbers. Some of the
numbers are formatted in Euro currency and some are formatted in USD currency.
I would like to put a formula in column C to automatically calculate the
currency conversion of the Euro to USD.

If cell B1 currency = Euro, then cell C1*1.45, else cell B1
Is there any way to do this?



How will any formula know whether the number is in euros of dollars,
unless you have a third column which defines the currency of col B
amounts?

Rgds
__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________

Per Erik Midtrød

If statement based on currency format
 
Hello.

I dont' think there is any built-in function to do this, but this one
might just work:
Public Function CheckEuro(rng As Range) As Boolean
Application.Volatile
CheckEuro = False
If rng.NumberFormatLocal = "[$€-2] # ##0,00" Then ' You need to
'excatly check what format you are using
CheckEuro = True
End If
End Function

Press Alt+F11 and choose insert Procedure and choose funcion.
It returns true if then number format in the cell you are testing is
excatly: "[$€-2] # ##0,00"

Then you could use the following if-formula
IF(checkEuro(B1)=TRUE;B1*1,5;A1)

You must make sure that the number format you are using for Euro is
excatly as shwon in the formula. If you are using different formats
you might manage to do something with a clever use of the left
function in vba.

Best regards
Per Erik



On Mon, 18 Sep 2006 11:35:02 -0700, juliejg1
wrote:

I have a spreadsheet that has a column (column B) of numbers. Some of the
numbers are formatted in Euro currency and some are formatted in USD currency.
I would like to put a formula in column C to automatically calculate the
currency conversion of the Euro to USD.

If cell B1 currency = Euro, then cell C1*1.45, else cell B1
Is there any way to do this?


juliejg1

If statement based on currency format
 
Thank you all for your help! Very useful, I got what I needed

"juliejg1" wrote:

I have a spreadsheet that has a column (column B) of numbers. Some of the
numbers are formatted in Euro currency and some are formatted in USD currency.
I would like to put a formula in column C to automatically calculate the
currency conversion of the Euro to USD.

If cell B1 currency = Euro, then cell C1*1.45, else cell B1
Is there any way to do this?



All times are GMT +1. The time now is 08:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com