I have a list of string like:
string
---
112358 lalala lalala
853211 lala lala 11$
lalala 1123 lalala 100%
and a specific list of:
ID's
---
112358
853211
1123
The aim is to substract from each string the ID value, if within the strings there actually is an ID (from list B) i.e.
string | matched ID
ID 112358 lalala lalala | 112358
853211 lala lala 11$ | 853211
lalala 1123 lalala 100%| 1123
lalala 100% | null
I found one way of doing this in Excel (but not exactly as mentioned above) - by searching if the ID value is contained in the string, like
=if(countif([RANGE OF STRINGS]," * "&[CELL WITH ID]&" * ")>0,"yes","no") which would return "yes" if ID is found in any of the strings
Is there a way of doing it the other way around? To extract the ID value from each string, if there actually is an ID present in any of the string (based on the list B)?
Interested in ways of doing this in either Excel or MySQL
