• Microsoft Office
  • Microsoft Windows
  • Other Software
    • Microsoft Visual
    • Microsoft Project
    • Microsoft Visio
  • Anti Virus
  • Blog
    • Word
    • Excel
    • Powerpoint
    • Software tricks/tips
  • POLICIES
    • PAYMENT GUIDE
    • SHIPPING POLICY
    • REFUND POLICY
    • TERMS & CONDITIONS
    • Contact Us

No products in the cart.

  • Microsoft Office
  • Microsoft Windows
  • Other Software
    • Microsoft Visual
    • Microsoft Project
    • Microsoft Visio
  • Anti Virus
  • Blog
    • Word
    • Excel
    • Powerpoint
    • Software tricks/tips
  • POLICIES
    • PAYMENT GUIDE
    • SHIPPING POLICY
    • REFUND POLICY
    • TERMS & CONDITIONS
    • Contact Us

No products in the cart.

  • Microsoft Office
  • Microsoft Windows
  • Other Software
    • Microsoft Visual
    • Microsoft Project
    • Microsoft Visio
  • Anti Virus
  • Blog
    • Word
    • Excel
    • Powerpoint
    • Software tricks/tips
  • POLICIES
    • PAYMENT GUIDE
    • SHIPPING POLICY
    • REFUND POLICY
    • TERMS & CONDITIONS
    • Contact Us

No products in the cart.

  • Microsoft Office
  • Microsoft Windows
  • Other Software
    • Microsoft Visual
    • Microsoft Project
    • Microsoft Visio
  • Anti Virus
  • Blog
    • Word
    • Excel
    • Powerpoint
    • Software tricks/tips
  • POLICIES
    • PAYMENT GUIDE
    • SHIPPING POLICY
    • REFUND POLICY
    • TERMS & CONDITIONS
    • Contact Us
Excel

How to extract numbers from a string in Excel

0 Comments

How to extract numbers from a string in Excel: You have been given a table of customer information and asked to extract only the numerical parts (phone numbers, customer IDs, ID card numbers, birth year, etc.) to a separate file for transactions or communication. How do you extract numbers from a large data table? Follow the steps below to learn how to do it.

For example, suppose we have a data table as shown in the image below. We need to extract the ID card number of each person. Since the data is not consistent, we cannot use basic character extraction functions like RIGHT, MID, LEFT. Follow the steps below to extract the numbers.

Step 1

First, use the Alt + F11 shortcut to open the Microsoft Visual Basic for Applications window. Then select the Insert tab on the toolbar. The scroll bar appears, select the Module option.

How to extract numbers from a string in Excel

How to extract numbers from a string in Excel

Step 2

Next, select and copy the entire code below by right-clicking and selecting Copy or using the Ctrl + C shortcut.

Function ExtractNumber(rCell As Range)
Dim lCount As Long
Dim sText As String
Dim lNum As String
sText = rCell
For lCount = Len(sText) To 1 Step -1
If IsNumeric(Mid(sText, lCount, 1)) Then
lNum = Mid(sText, lCount, 1) & lNum
End If
Next lCount
ExtractNumber = CLng(lNum)
End Function

Step 3

Go back to the Module window that was just opened, right-click, and select Paste or use the Ctrl + V shortcut to paste the copied code here.

How to extract numbers from a string in Excel

How to extract numbers from a string in Excel

 

Step 4

That’s it, the ExtractNumber function has been added to your Excel. Now, return to the worksheet and use the following formula:

=ExtractNumber(B2)

Copy the formula for the other cells below to quickly extract the ID card numbers of each person.

How to extract numbers from a string in Excel

How to extract numbers from a string in Excel

 

In this way, the above article has instructed you on how to extract numbers from a string in Excel. Hope the article is useful for you in your work. Good luck!

 

 

Rate this post
35
298 Views
Numbering Pages From Any Page In Word 2013, 2016, 2019PrevNumbering Pages From Any Page In Word 2013, 2016, 2019March 28, 2023
How to draw a stacked column chart in ExcelMarch 28, 2023How to draw a stacked column chart in ExcelNext

Leave a Reply Cancel reply

You must be logged in to post a comment.

Buy Windows 11 Professional MS Products CD Key
Buy Office 2021 Professional Plus Key Global For 5 PC
Top rated products
  • Kaspersky Internet Security 2021 1 year 5 devices key Global Kaspersky Internet Security 2021 1 year 5 devices key Global
    Rated 5.00 out of 5
    $45.00
  • Windows Server 2022 Datacenter Key Global Windows Server 2022 Datacenter Key Global
    Rated 5.00 out of 5
    $7.00
  • Kaspersky Small Office Security 10 PCs + 10 Mobiles + 1 Server 1 Year Kaspersky Small Office Security 10 PCs + 10 Mobiles + 1 Server 1 Year
    Rated 5.00 out of 5
    $164.50
  • Avast Ultimate Suite 2021 1 Year 10 Devices Global Avast Ultimate Suite 2021 1 Year 10 Devices Global
    Rated 5.00 out of 5
    $54.00
  • Windows 11 Pro Key Global Windows 11 Pro Key Global
    Rated 5.00 out of 5
    $6.00
Products
  • Microsoft Project 2016 professional CD Key Global Microsoft Project 2016 professional CD Key Global
    Rated 4.97 out of 5
    $9.00
  • Microsoft Visual Studio 2019 Professional Key Microsoft Visual Studio 2019 Professional Key
    Rated 4.84 out of 5
    $15.00
  • Avast SecureLine VPN 2021 1 Year 5 Devices Global Avast SecureLine VPN 2021 1 Year 5 Devices Global
    Rated 4.91 out of 5
    $34.00
  • Kaspersky Plus - 1 Device 1 Year - GLOBAL Kaspersky Plus - 1 Device 1 Year - GLOBAL $23.00
  • Trend Micro Internet Security 3 Devices 1 Year Key GLOBAL Trend Micro Internet Security 3 Devices 1 Year Key GLOBAL
    Rated 5.00 out of 5
    $17.00
  • Windows Server 2012 R2 Datacenter Key Global Windows Server 2012 R2 Datacenter Key Global
    Rated 4.71 out of 5
    $15.00
  • Microsoft Office Professional Plus 2010 retail Microsoft Office Professional Plus 2010 retail Key Global - 5 PC
    Rated 4.96 out of 5
    $15.00
  • Buy Windows 11 Professional MS Products CD Key Buy Windows 11 Professional MS Products CD Key
    Rated 5.00 out of 5
    $6.00
  • Avast Premium Security 2021 10 Devices 1 Year Global Avast Premium Security 2021 10 Devices 1 Year Global
    Rated 5.00 out of 5
    $28.00
  • Windows Server 2016 Standard Key Global Windows Server 2016 Standard Key Global
    Rated 4.80 out of 5
    $10.00
Product categories
  • Anti Virus
  • Microsoft Office
  • Microsoft Project
  • Microsoft Visio
  • Microsoft Visual
  • Microsoft Windows
  • Other Software
  • Uncategorized

Buffcom.net always brings the best digital products and services to you. Specializing in Office Software and online marketing services

BIG SALE 50% IN MAY

Microsoft Office
Microsoft Windows
Anti-Virus
Contact Us

Visit Us:

125 Division St, New York, NY 10002, USA

Mail Us:

buffcom.net@gmail.com

TERMS & CONDITIONS | PAYMENT GUIDE  | SHIPPING POLICY  | REFUND POLICY

Copyright © 2019 buffcom.net  All Rights Reserved.