Forum Discussion
Vlookup to find multiple variations of a text string
- Apr 24, 2019
A formula solution. The key element is to perform a wildcard search for anything that contains a shift name, e.g. search for "*LMP*". There is a catch that the abbreviations for Early and Late are to be found within other shift codes so I converted them to "E0" and "L0" to avoid 'false positives'.
= IFERROR( INDEX( Name, MATCH( shift, INDEX(shiftTable, 0, day), 0 ) ), "" )
The names 'day' and 'shift' are relative references and the innermost INDEX returns the 3 rows for a given day of the table.
As for your other line of exploration, Power Query is available as an Office 2010 add-in free of charge from Microsoft. Your IT department could install it for you and I would recommend that they evaluate it themselves!
Did you compare your solution with my solution?
Your missing some shifts: DO, LMP1.
And your missing multiple names for the same shift on the same day.
And LMP produces false positives because of LMP1 and LMP2.
- othafaApr 26, 2019Copper Contributor
Detlef_Lewin PeterBartholomew1
Peter's solution looks good, I'll need to run it in the real schedule obviously to test it.
Not concerned if it doesnt pick up DO as those are days off which we don't need to display on sheet 2 (in Peter's solution I was intending to deselect DO and AL in the filter section of the pivot table using a macro) but would be concerned if it doesnt pick up duplicates at all.
My bad, the LMP should be LMP1 but we only use a number in shift codes if there are two people doing the same shift. In other words there is a CWE but will never be a CWE1 or CWE2. I think Ive just resolved the duplicate issue....the only duplicates we do use are the E and L shifts and we could possibly number them so no need to call them EO and LO.
Ill try the download myself but company admin privaledges may prevent me doing that, if so and I get someone in IT to look at it for me they may just come back and tell me it wont work!
Watch this space and thanks again for the help.