top of page
9d657493-a904-48e4-b46b-e08acb544ddf.png

POSTS

Power Query: Extract Numbers from a Text String

Updated: May 28

Function: Extracts only the numeric values from a given text. Simply add custom function in Power Query and define your column.


Power Query editor interface showing a code script titled Query1 with text editor on the right; toolbar and navigation pane on the left.
Add a new Query from Sources


Usage:

 = ExtractNumbers("Order ID: 123ABC456") → Returns: "123456"

Power Query code for use and reuse:

let
    ExtractNumbers = (inputText as text) as text =>
    let
        NumbersOnly = Text.Select(inputText, {"0".."9"})
    in
        NumbersOnly
in
    ExtractNumbers


Spreadsheet software with "Add Column" tab highlighted. A data table shows columns like "Valid" and "Error" with percentages. Query1 is selected.
Choose your column with a text/number to clean (to extract just numbers)


Need a code and instructions? Free of charge =)




Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
Official Logo of the Webpage

Transform your data with our data analytics services! From Excel to Power BI with Power Query in the background, drive your business forward!

  • Linkedin
  • Xing
  • RSS
  • 4844455

Contact Us

Address:
83022 Rosenheim, Bavaria

Join Us!

Stay updated with tips & tutorials!

© 2025 By Excelized. | SITE DESIGNED BY RS-TECH

bottom of page