• 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
42
308 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
  • AVG Internet Security 2021 10 Devices 2 Years Global AVG Internet Security 2021 10 Devices 2 Years Global
    Rated 5.00 out of 5
    $42.20
  • Trend Micro Maximum Security 3 Devices 1 Year key Global Trend Micro Maximum Security 3 Devices 1 Year key Global
    Rated 5.00 out of 5
    $15.00
  • Windows 11 Home Key Global 2021 Windows 11 Home Key Global 2021
    Rated 5.00 out of 5
    $6.00
  • Windows Server 2022 Remote Desktop Services User Connections (50) Cal Key Global Windows Server 2022 Remote Desktop Services User Connections (50) Cal Key Global
    Rated 5.00 out of 5
    $22.00
  • AVG Ultimate 2021 with Antivirus + Cleaner, Secure VPN 10 Devices 2 Years AVG Ultimate 2021 with Antivirus + Cleaner, Secure VPN 10 Devices 2 Years
    Rated 5.00 out of 5
    $47.00
Products
  • Windows Server 2025 Remote Desktop Services 50 Device Connections Windows Server 2025 Remote Desktop Services 50 Device Connections $25.00
  • Microsoft Office Professional Plus 2010 retail Microsoft Office Professional Plus 2010 retail CD Key Global
    Rated 4.90 out of 5
    $11.00
  • Kaspersky Total Security 2021 1 year 5 devices key Global Kaspersky Total Security 2021 1 year 5 devices key Global
    Rated 5.00 out of 5
    $46.00
  • Windows Server 2025 Standard Windows Server 2025 Standard $30.00
  • Office 2016 Home and Student for PC Key CD Key Global Office 2016 Home and Student for PC Key CD Key Global
    Rated 4.96 out of 5
    $14.00
  • SQL Server 2014 Standard SQL Server 2014 Standard $20.00
  • Windows 10 Enterprise LTSC 2019 Key Global Windows 10 Enterprise LTSC 2019 Key Global
    Rated 4.83 out of 5
    $9.00
  • Microsoft Visio Standard 2021 Key 1PC Microsoft Visio Standard 2021 Key 1PC $13.00
  • Windows Server 2019 Datacenter Key Global Windows Server 2019 Datacenter Key Global
    Rated 4.75 out of 5
    $7.00
  • Avast Ultimate Suite 2021 3 Years 10 Devices Global Avast Ultimate Suite 2021 3 Years 10 Devices Global
    Rated 5.00 out of 5
    $90.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.