Fetch currency name from data of different currencies

Chartist

Board Regular
Joined
Apr 2, 2007
Messages
138
Office Version
  1. 365
Platform
  1. Windows
I have a large sheet with transactions in many currencies including custom ones (some have symbols like $ or £, and some prefixed with letter codes like NGN).

Is there a way to extract the currency of each in a column next to it? Thanks.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Suppose your data is in an 'A' column.
In the 'B' column, convert the values to text (using UDF by @xenou).

In the 'C' column place this formula below
Code:
=TRIM(SUBSTITUTE(B2,TEXT(A2,"#.##0,00"),""))
 

Attachments

  • extractedcurrencysymbol.png
    extractedcurrencysymbol.png
    7 KB · Views: 11
Upvote 0
Suppose your data is in an 'A' column.
In the 'B' column, convert the values to text (using UDF by @xenou).

In the 'C' column place this formula below
Code:
=TRIM(SUBSTITUTE(B2,TEXT(A2,"#.##0,00"),""))
Thanks for the reply. I couldn't make it work yet.

I have the cells with currency in column A now. I copied the TRIM(SUBSTITUTE(B2,TEXT(A2,"#.##0,00"),"") formula in column C.

I tried pasting values from column A to B and formatting it as text. What do I need to do in Column B? Thanks
 
Upvote 0
Here are the procedures, a little more detail

- Activate Sheet1
- Open VBE with ALT + F11
- Click Insert -> Module
- Copy this VBA code below to Standard Module in VBE for Excel
VBA Code:
Function GetTextValue(ByVal arg As Range) As String
'by xenou
     GetTextValue = arg.Cells(1, 1).Text '//Cell value (or top left cell value if range is more than one cell)
End Function
- Copy this formula below to the 'B2' cell (copy down)
Code:
=GetTextValue(A2)
- In 'C2' cell copy this formula below (copy down)
Code:
=TRIM(SUBSTITUTE(B2,TEXT(A2,"#.##0,00"),""))
- Save the Workbook in *.xlsm or *.xls or *.xlsb format
 
Upvote 0
thanks friend, i followed those steps and tried it twice, but all columns are showing identical outputs
£500.00
NGN 630
etc
Not sure what I'm doing wrong.
 
Upvote 0
I don't know how else to help you.
I use Non-US regional setting.
See screenshots.
 

Attachments

  • copypastevbacodeintoexcelvbe.png
    copypastevbacodeintoexcelvbe.png
    19.1 KB · Views: 5
  • extractcurrencysymbol2.png
    extractcurrencysymbol2.png
    7.9 KB · Views: 5
Upvote 0
Hi
try changing the . (dot) to a , (comma) between the hash symbols #,##

Code:
=TRIM(SUBSTITUTE(B2,TEXT(A2,"#.##0,00"),""))
Code:
=TRIM(SUBSTITUTE(B2,TEXT(A2,"#,##0,00"),""))
 
Upvote 0

Forum statistics

Threads
1,214,861
Messages
6,121,971
Members
449,059
Latest member
oculus

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