Results 1 to 1 of 1

Thread: PQ - Extracting a number that is a percentage from text

  1. #1
    Sir Moderator sandy666's Avatar
    Join Date
    May 2018
    Posts
    234
    Rep Power
    7

    Cool PQ - Extracting a number that is a percentage from text

    (question from the web)
    I am new to Excel Power Query & love it! Question: does anyone know the formula to use to be able to make a separate column from the example below?
    Dewalt Drill Yellow and Black 2.0% hardware store.
    Question: How would I create a new column that only has the 2.0% from this text?
    src src percents
    Dewalt Drill Yellow and Black 2.0% hardware store. Dewalt Drill Yellow and Black 2.0% hardware store.
    2.0%
    Kobalt Drill Blue 52.3% Kobalt Drill Blue 52.3%
    52.3%
    Hitachi Drill Green 6.9% Hitachi Drill Green 6.9%
    6.9%

    Code:
    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        TS = Table.AddColumn(Source, "percents", each Number.FromText(Text.Select([src], {"0".."9"}))/1000)
    in
        TS
    after load query table to the sheet change column percents to Percentage and increase decimal about one place
    percentdec.png
    Last edited by sandy666; 03-05-2021 at 04:55 AM.
    sandy
    I know you know but I forgot my Crystal Ball and don't know what you know also I may not remember what I did weeks, months or years ago so answer asap. Thinking doesn't hurt

Similar Threads

  1. Extract Number From Alphanumeric Text
    By Excel Fox in forum Excel and VBA Tips and Tricks
    Replies: 10
    Last Post: 09-11-2013, 10:14 PM
  2. Replies: 7
    Last Post: 08-29-2013, 12:01 PM
  3. Replies: 6
    Last Post: 06-01-2013, 03:24 PM
  4. Replies: 14
    Last Post: 05-25-2013, 06:55 AM
  5. Extracting Numeric Values From Alphanumeric Text
    By Safal Shrestha in forum Excel Help
    Replies: 3
    Last Post: 03-21-2013, 12:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •