Extracting a number that is a percentage from text

ktruninger

New Member
Joined
Mar 4, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
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?
Thank you!
Ken
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
How about this?

New__Document (60).xlsx
ABCDEF
2Column1Column1Custom
3Dewalt Drill Yellow and Black 2.0% hardware store.Dewalt Drill Yellow and Black 2.0% hardware store.2.0%
4Kobalt Drill Blue 52.3%Kobalt Drill Blue 52.3%52.3%
5Hitachi Drill Green 6.9%Hitachi Drill Green 6.9%6.9%
Sheet7


Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Extract = Table.AddColumn(Source, "Custom", each Table.RemoveRowsWithErrors(Table.TransformColumns(Table.FromList(Text.Split([Column1]," ")),{{"Column1",each Number.From(_)}}))[Column1]{0}),
    Types = Table.TransformColumnTypes(Extract,{{"Column1", type text}, {"Custom", Percentage.Type}})
in
    Types
 
Upvote 0
Thank you! Now I have to see if I can do this on my own!
Appreciate your help.
Ken
 
Upvote 0
This is a bit easier to follow or replicate.

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
    Split = Table.AddColumn(Source, "Custom", each Text.Split([Column1]," ")),
    ToNumber = Table.TransformColumns(Split,{{"Custom", each try List.Transform(_, Number.From) otherwise null}}),
    Expand = Table.ExpandListColumn(ToNumber, "Custom"),
    RemoveErrors = Table.RemoveRowsWithErrors(Expand, {"Custom"}),
    Types = Table.TransformColumnTypes(RemoveErrors,{{"Column1", type text}, {"Custom", Percentage.Type}})
in
    Types
 
Upvote 0
Please try


Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    APrecent = Table.AddColumn(Source, "Percent", each Number.From(Text.Trim(Text.Select([Column1],{"0".."9",".","%"}),".")),Percentage.Type)
in
    APrecent
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top