• 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
37
302 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
  • 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
  • Avast Premium Security 2021 10 Devices 2 Years Global Avast Premium Security 2021 10 Devices 2 Years Global
    Rated 5.00 out of 5
    $41.00
  • Kaspersky Small Office Security 15 PCs + 15 Mobiles + 2 Servers 1 Year Kaspersky Small Office Security 15 PCs + 15 Mobiles + 2 Servers 1 Year
    Rated 5.00 out of 5
    $201.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
Products
  • Project Professional 2013 Microsoft Project Professional 2013 - 1 PC $9.00
  • Kaspersky Plus - 1 Device 1 Year - GLOBAL Kaspersky Plus - 1 Device 1 Year - GLOBAL $23.00
  • AVG Ultimate 2021 with Antivirus + Cleaner, Secure VPN 10 Devices 1 Year AVG Ultimate 2021 with Antivirus + Cleaner, Secure VPN 10 Devices 1 Year
    Rated 4.91 out of 5
    $34.00
  • 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 Server 2019 Remote Desktop Services 50 USER Connections Key Global Windows Server 2019 Remote Desktop Services 50 USER Connections Key Global
    Rated 4.75 out of 5
    $20.00
  • Microsoft Visual Studio Enterprise 2019 For 1 PC Microsoft Visual Studio Enterprise 2019 For 1 PC
    Rated 4.88 out of 5
    $15.00
  • Windows 10 Pro Key Global Genuine Key Windows 10 Pro Key Global Genuine Key
    Rated 4.78 out of 5
    $6.00
  • Microsoft Visio Professional 2010 Key 1PC Microsoft Visio Professional 2010 Key 1PC $9.00
  • Avast Ultimate Suite 2021 2 Years 10 Devices Global Avast Ultimate Suite 2021 2 Years 10 Devices Global
    Rated 5.00 out of 5
    $77.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
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.