Give currency of formatted cell

joeypar

New Member
Joined
Aug 15, 2018
Messages
3
Hey,

I've got a bunch of data from a BI source, but they havent provided the currency. The values are formatted in the correct currency, so i want to write a formula in another cell that will tell me what currency each line is in. Any idea how i can do this? I'm sure i've done this before but completely forgotten and cant find anything online
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Example data ?

"The values are formatted in the correct currency,"

Do you mean the values coming in are text? Or the cells are numbers and the cell format is "Currency" ?
 
Upvote 0
Doesnt look like you can do that with a formula.
I found this UDF that produces different output for different currencie

Code:
Function ccyform(ByRef c As Range)
x = c.NumberFormat
For i = 1 To Len(x)
    If Not Mid(x, i, 1) = " " Then
        y = y + 1
    Else
        Exit For
    End If
   Next
ccyform = Left(x, y)
    
End Function
 
Upvote 0
Thanks! It didnt work exactly, but i was able to use a part of it to get the data i needed. I just used this to get the full format, and then map the formats to currencies:


Function CurrencyFormat(ByRef c As Range)


CurrencyFormat = c.NumberFormat

End Function
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

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