How to Extract Numbers from Text in Excel | 3 Methods - Power Query, VBA Function & TEXTJOIN Formula
Автор: Chester Tugwell
Загружено: 2021-04-13
Просмотров: 124159
📽️In this video I demonstrate three methods for separating text from numeric characters within a text string. The methods are:
1) Power Query - create a column by example. PowerQuery is installed by default in the more recent versions of Excel. If you don't have it, download the add-in from here https://www.microsoft.com/en-gb/downl...
2) VBA functions
3) TEXTJOIN formula. TEXTJOIN is only available in more recent versions of Excel.
👍👍If you have found this content useful and want to show your appreciation, please use this link to buy me a beer 🍺.
https://www.paypal.com/donate/?hosted...
Thank you! 👍👍
Download the featured file & code here https://www.bluepecantraining.com/wp-...
VBA Code:
-------------------------------------------------------
Function ExtractNumbers(Value As String)
Dim StrLength As Integer
StrLength = Len(Value)
Dim i As Integer
Dim NumericChars As String
For i = 1 To StrLength
If IsNumeric(Mid(Value, i, 1)) Then NumericChars = NumericChars & Mid(Value, i, 1)
Next i
ExtractNumbers = NumericChars
End Function
Function ExtractText(Value As String)
Dim StrLength As Integer
StrLength = Len(Value)
Dim i As Integer
Dim TextChars As String
For i = 1 To StrLength
If Not IsNumeric(Mid(Value, i, 1)) Then TextChars = TextChars & Mid(Value, i, 1)
Next i
ExtractText = TextChars
End Function
------------------------
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: