IF Formula

Excel_Assis

Board Regular
Joined
Feb 19, 2011
Messages
132
Office Version
  1. 2016
Platform
  1. Windows
Can you help me with a formula that work on the following:

If the data entered in a cell shows a B like B1543.87 it would be converted to US$ but if the data entered in the cell is $1543.87 then no action taken.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Krishnakumar thank you for your reply. Could I ask you to please explain how this formula works.
 
Upvote 0
Hi,

LEFT(A1) will give you the first character of A1

if it's "b" then the next step

MID(A1,2,25) will give everything after the first character (25 can be replace with len(a1))

now the result will look like "1543.87". This is not a TRUE number. To convert this text value into a number we put '--' in front of MID.

It can also be written as

MID(A1,2,25)+0

MID(A1,2,25)*1

HTH
 
Upvote 0
Krishnakumar thanks again for the reply, however not exactly what I want to do. If the number has a B at the beginning like B1234.00 then convert to us$ so a calculation has to take place but if the is a $ at the beginning of the number then do nothing as the amount is already in US$.

This is so I can get amounts entered both foreign and US$ in to US$ then add them to get a total.
 
Upvote 0
I think you may be looking for a different solution.

Then in continuity to Krishnakumar's reply, just change the formula as below :

=IF(LEFT(A1)="B",--MID(A1,2,25)/????,A1)

Put the currency exchange conversion figure instead of ???? and you will get your desired result.
 
Upvote 0
Sanjeev1976 thank you that is correct. Krishnakumar thank you too for your help Sanjeev1976 understood what I was looking to do. You have to add an exchange rate to convert to US$ not just change the symbol.
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,682
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top