sandramac
asked on
Remove parenthesis from data
I have data in cell A47, that has a parenthesis at the end. I need to extract just the numbers and leave out the ")"
Example is 77,965.52) I need a formula to give me 77,965.52.
Example is 77,965.52) I need a formula to give me 77,965.52.
Here is a solution using the same regex function I provided in your prior question. It finds the number at the end of the cell content and then removes the paren.
EE29141238.xlsm
»bp
EE29141238.xlsm
»bp
If A47 only contains the string 77,965.52), you may try Substitute formula to remove the ")" from the cell.
If A47 contains some other text as well along with the number, you may place this UDF on a standard module like Module1.
=SUBSTITUTE(A47,")","")
If A47 contains some other text as well along with the number, you may place this UDF on a standard module like Module1.
Function getNumber(str As String)
With CreateObject("VBScript.RegExp")
.Global = False
.Pattern = "\d+\,?\d+\.?\d{2}"
If .test(str) Then
getNumber = .Execute(str)(0)
End If
End With
End Function
And then use this formula to get the number from the string in A47.=getNumber(A47)
GetNumber.xlsm
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
»bp