Remove any word from the sentence that contains a number

Dossfm0q

Banned User
Joined
Mar 9, 2009
Messages
570
Office Version
  1. 2019
Platform
  1. Windows
formula form array words to remove whole word that have numbers

Excel Formula:
=IFERROR(IF(FIND({0,1,2,3,4,5,6,7,8,9;0,1,2,3,4,5,6,7,8,9;0,1,2,3,4,5,6,7,8,9},MID(A2,FIND("|",SUBSTITUTE(" "&A2&" "," ","|",ROW(INDIRECT("1:"&LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1)))),FIND(" ",A2&" ",FIND("|",SUBSTITUTE(" "&A2&" "," ","|",(ROW(INDIRECT("1:"&LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1))))))-FIND("|",SUBSTITUTE(" "&A2&" "," ","|",(ROW(INDIRECT("1:"&LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1)))))),1)<>0,MID(A2,FIND("|",SUBSTITUTE(" "&A2&" "," ","|",ROW(INDIRECT("1:"&LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1)))),FIND(" ",A2&" ",FIND("|",SUBSTITUTE(" "&A2&" "," ","|",(ROW(INDIRECT("1:"&LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1))))))-FIND("|",SUBSTITUTE(" "&A2&" "," ","|",(ROW(INDIRECT("1:"&LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1)))))),""),"")
Excel Formula:
=MID(A2,FIND("|",SUBSTITUTE(" "&A2&" "," ","|",ROW(INDIRECT("1:"&LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1)))),FIND(" ",A2&" ",FIND("|",SUBSTITUTE(" "&A2&" "," ","|",(ROW(INDIRECT("1:"&LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1))))))-FIND("|",SUBSTITUTE(" "&A2&" "," ","|",(ROW(INDIRECT("1:"&LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1))))))

HHH.xlsx
ABC
1TextFormulaResult
2P1 FMD 15h FMD
3P1X
NN
Cell Formulas
RangeFormula
B2B2=IFERROR(IF(FIND({0,1,2,3,4,5,6,7,8,9;0,1,2,3,4,5,6,7,8,9;0,1,2,3,4,5,6,7,8,9},MID(A2,FIND("|",SUBSTITUTE(" "&A2&" "," ","|",ROW(INDIRECT("1:"&LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1)))),FIND(" ",A2&" ",FIND("|",SUBSTITUTE(" "&A2&" "," ","|",(ROW(INDIRECT("1:"&LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1))))))-FIND("|",SUBSTITUTE(" "&A2&" "," ","|",(ROW(INDIRECT("1:"&LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1)))))),1)<>0,MID(A2,FIND("|",SUBSTITUTE(" "&A2&" "," ","|",ROW(INDIRECT("1:"&LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1)))),FIND(" ",A2&" ",FIND("|",SUBSTITUTE(" "&A2&" "," ","|",(ROW(INDIRECT("1:"&LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1))))))-FIND("|",SUBSTITUTE(" "&A2&" "," ","|",(ROW(INDIRECT("1:"&LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1)))))),""),"")
B3B3=MID(A2,FIND("|",SUBSTITUTE(" "&A2&" "," ","|",ROW(INDIRECT("1:"&LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1)))),FIND(" ",A2&" ",FIND("|",SUBSTITUTE(" "&A2&" "," ","|",(ROW(INDIRECT("1:"&LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1))))))-FIND("|",SUBSTITUTE(" "&A2&" "," ","|",(ROW(INDIRECT("1:"&LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1))))))
Press CTRL+SHIFT+ENTER to enter array formulas.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
another option
RawDataRawData
P1 FMD 15hFMD

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Split = Table.ExpandListColumn(Table.TransformColumns(Source, {{"RawData", Splitter.SplitTextByDelimiter(" ", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "RawData"),
    Numbers = Table.AddColumn(Split, "Nr", each Text.Select([RawData], {"0".."9"})),
    Filter = Table.SelectRows(Numbers, each ([Nr] = "")),
    RC = Table.RemoveColumns(Filter,{"Nr"})
in
    RC
 
Upvote 0
thank you for advance, great and perfect answer
But
unfortunately I am not familiar with Power Query, so I am waiting for anther answer with formula
 
Upvote 0
in case you've more than one word without number(s)

RawDataResult
P1 FMD 15hFMD
ADE 23VX 24drtADE
aX 4ko By 55zR DDaX By DD
12D ERR 5THC VALERR VAL
LZ 1A DEF 2 C 5 QWA 6FF sandy sandy666LZ DEF C QWA sandy

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table5"]}[Content],
    Index = Table.AddIndexColumn(Source, "Index", 1, 1),
    Split = Table.ExpandListColumn(Table.TransformColumns(Index, {{"RawData", Splitter.SplitTextByDelimiter(" ", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "RawData"),
    Numbers = Table.AddColumn(Split, "Nr", each Text.Select([RawData], {"0".."9"})),
    Filter = Table.SelectRows(Numbers, each ([Nr] = "")),
    Grp = Table.Group(Filter, {"Index"}, {{"Count", each _, type table}}),
    List = Table.AddColumn(Grp, "Result", each [Count][RawData]),
    Extract = Table.TransformColumns(List, {"Result", each Text.Combine(List.Transform(_, Text.From), " "), type text}),
    TSC = Table.SelectColumns(Extract,{"Result"})
in
    TSC
 
Upvote 0
Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

- Follow this link to learn how to install Power Query in Excel 2010 / 2013.

- Follow this link for an introduction to Power Query functionality.

- Follow this link for a video which demonstrates how to use Power Query code provided.
 
Upvote 0
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as your version(s) determine what functions and resources are available to you. (Don’t forget to scroll down & ‘Save’)

Also, would a formula involving a user-defined function be acceptable?
 
Upvote 0

Forum statistics

Threads
1,214,386
Messages
6,119,216
Members
448,876
Latest member
Solitario

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