Power Query IF Function - How to search for part of a word and get anything that contains it

bowlingbear6

New Member
Joined
Feb 18, 2018
Messages
2
Greetings!

Needing help with a Power Query function.

I am trying to do an if formula thatwill find part of a word and return a true if found. Example if I amtrying to find all words that contain fault I want fault and faulty to be returnedas true. Similar to the search function in excel. I tried using wild card infront of and at the end of the word but that didn’t work.

So after 2 hours ofstruggling I figured I would ask for help.




Thanks inadvance.
Derek
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Thank you sandy666 for responding. I was trying that but would only get exact matches. It is excluding words that contain the phrase that don't match exactly.IE....searching for weld would not find welded.
 
Upvote 0
Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Added Conditional Column" = Table.AddColumn(Source, "Custom", each if Text.Contains([Column1], "[B][COLOR="#FF0000"]weld[/COLOR][/B]") then true else null)
in
    #"Added Conditional Column"[/SIZE]

[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td=bgcolor:#5B9BD5]Column1[/td][td][/td][td=bgcolor:#70AD47]Column1[/td][td=bgcolor:#70AD47]Custom[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]searching for * would not find welded.[/td][td][/td][td=bgcolor:#E2EFDA]searching for * would not find welded.[/td][td=bgcolor:#E2EFDA]
TRUE​
[/td][/tr]
[/table]


you must remember: Power Query is case sensitive
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,141
Members
453,021
Latest member
Justyna P

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