Forum Discussion
uayan
4 years agoFrequent Visitor
Extract text from cell if any.
I have a column like that.
| AB1 xx yy zz |
| yy xx zz AB2 |
| xx yy zz AB1 |
| xx yy yy zz |
| xx yy zz zz AB3 |
I want to create calculated column and need formula that
If there is AB1 value, type AB1,
If there is AB2 value, type AB2,
If there is AB3 value, type AB3,
If there is no ABx value, type "No value"
This should be the result...
| AB1 |
| AB2 |
| AB1 |
| No value |
| AB3 |
- I have solved like thatColumn = SWITCH(TRUE(),SEARCH("AB1",Sheet[Labels],,0)>1, "AB1",SEARCH("AB2",Sheet1[Labels],,0)>1,"AB2","No Value")
2 Replies
- amitchandak
Super User
uayan , Try to use Text.Split and List.Select with or condition
a new column in power query
Text.Combine(List.Select(Text.Split([Column], each Text.Contains(_, "AB") ), ",")
- uayanFrequent VisitorI have solved like thatColumn = SWITCH(TRUE(),SEARCH("AB1",Sheet[Labels],,0)>1, "AB1",SEARCH("AB2",Sheet1[Labels],,0)>1,"AB2","No Value")