ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to extract just text from cells (https://www.excelbanter.com/excel-worksheet-functions/185564-how-extract-just-text-cells.html)

Access Joe

How to extract just text from cells
 
Hi all,

I want to extract only TEXT from a column of numbers and text. For example:

WHAT I HAVE:
150mgdl
2000mg
10mgdl
500cc

WHAT I WANT:
mgdl
mg
mgdl
cc

is there a function in Excel that does this and extracts only the text, not
the numbers?

Thanks everyone!




ryguy7272

How to extract just text from cells
 
Try this:
=MID(A15,SUMPRODUCT(--ISNUMBER(--MID(A1,ROW($1:$999),1)))+1,999)


Regards,
Ryan--

--
RyGuy


"Access Joe" wrote:

Hi all,

I want to extract only TEXT from a column of numbers and text. For example:

WHAT I HAVE:
150mgdl
2000mg
10mgdl
500cc

WHAT I WANT:
mgdl
mg
mgdl
cc

is there a function in Excel that does this and extracts only the text, not
the numbers?

Thanks everyone!




ryguy7272

How to extract just text from cells
 
This shoudl work as well:
Function RemDigits(str As String) As String
Dim re As Object
Set re = CreateObject("vbscript.regexp")
re.Global = True
re.Pattern = "\d+"
RemDigits = re.Replace(str, "")
End Function

Regards,
Ryan--

--
RyGuy


"Access Joe" wrote:

Hi all,

I want to extract only TEXT from a column of numbers and text. For example:

WHAT I HAVE:
150mgdl
2000mg
10mgdl
500cc

WHAT I WANT:
mgdl
mg
mgdl
cc

is there a function in Excel that does this and extracts only the text, not
the numbers?

Thanks everyone!




Access Joe

How to extract just text from cells
 
PERFECT - THANKS!

"ryguy7272" wrote:

Try this:
=MID(A15,SUMPRODUCT(--ISNUMBER(--MID(A1,ROW($1:$999),1)))+1,999)


Regards,
Ryan--

--
RyGuy


"Access Joe" wrote:

Hi all,

I want to extract only TEXT from a column of numbers and text. For example:

WHAT I HAVE:
150mgdl
2000mg
10mgdl
500cc

WHAT I WANT:
mgdl
mg
mgdl
cc

is there a function in Excel that does this and extracts only the text, not
the numbers?

Thanks everyone!




ryguy7272

How to extract just text from cells
 
If that was helpful, click 'Yes' to indicate that!!

Thanks,
Ryan--

--
RyGuy


"ryguy7272" wrote:

This shoudl work as well:
Function RemDigits(str As String) As String
Dim re As Object
Set re = CreateObject("vbscript.regexp")
re.Global = True
re.Pattern = "\d+"
RemDigits = re.Replace(str, "")
End Function

Regards,
Ryan--

--
RyGuy


"Access Joe" wrote:

Hi all,

I want to extract only TEXT from a column of numbers and text. For example:

WHAT I HAVE:
150mgdl
2000mg
10mgdl
500cc

WHAT I WANT:
mgdl
mg
mgdl
cc

is there a function in Excel that does this and extracts only the text, not
the numbers?

Thanks everyone!





All times are GMT +1. The time now is 05:42 AM.

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