fbpx
Search
Close this search box.

Job Title Matching Problem [Excel Homework]

Share

Facebook
Twitter
LinkedIn

Howdy folks. Almost the end of August here. Let’s wrap it up with a nice little partial text match in Excel challenge, inspired from my recent consulting gig. Say you are looking at few job titles that look similar and want to match them to correct title. Like below:

partial text match in Excel - how to match multiple job titles to one value?

The assumptions are,

  • Extra words or characters will be always at end
  • The job list may not be in alphabetical order

How would you match? Obviously VLOOKUP won’t cut it. I know over the week Microsoft released XLOOKUP to the beta testers out in wild, but that probably won’t cut it either. So what next? How would you solve this problem?

Well, that is your homework.

To participate, simply download job title matching problem worksheet and use either formulas, Power Query or VBA to match the jobs. Post your solution formulas, M scripts, macros or haiku in the comments.

Can’t solve or won’t bother? Here is the solution…

Oh well, I guess your job titles are far cleaner than what I am used to. If you are just impatient, the download problem file has hidden worksheet with formula solution and Power Query connection.

I made a video explaining the partial text match Excel problem, my solutions (both formula and PQ). Check it out below or on my YouTube Channel.

Bored at work or home, need a challenge? Solve these Excel problems…

Solving hard problems is a good way to learn new things. So if you are up for a challenge, check out below Homework problems.

Good luck and don’t forget to post your answers in comments.

Facebook
Twitter
LinkedIn

Share this tip with your colleagues

Excel and Power BI tips - Chandoo.org Newsletter

Get FREE Excel + Power BI Tips

Simple, fun and useful emails, once per week.

Learn & be awesome.

Welcome to Chandoo.org

Thank you so much for visiting. My aim is to make you awesome in Excel & Power BI. I do this by sharing videos, tips, examples and downloads on this website. There are more than 1,000 pages with all things Excel, Power BI, Dashboards & VBA here. Go ahead and spend few minutes to be AWESOME.

Read my storyFREE Excel tips book

Overall I learned a lot and I thought you did a great job of explaining how to do things. This will definitely elevate my reporting in the future.
Rebekah S
Reporting Analyst
Excel formula list - 100+ examples and howto guide for you

From simple to complex, there is a formula for every occasion. Check out the list now.

Calendars, invoices, trackers and much more. All free, fun and fantastic.

Advanced Pivot Table tricks

Power Query, Data model, DAX, Filters, Slicers, Conditional formats and beautiful charts. It's all here.

Still on fence about Power BI? In this getting started guide, learn what is Power BI, how to get it and how to create your first report from scratch.

12 Responses to “Job Title Matching Problem [Excel Homework]”

  1. sfunez says:

    Hi.
    not sure if this is the right answer but I made it this way : VLOOKUP(LEFT('Job title cell',LEN('Matching job cell')),'matching job range',1,FALSE) and it worked.

  2. jomili says:

    I made a list of the desired options, stored it in I3:I8, then did a simple VLookup like this:
    =VLOOKUP(LEFT([@[Job title]],10)&"*",$I$3:$I$8,1,FALSE)

  3. Dale A says:

    I made a list of Job Titles I was looking for in the range G4:G9 then did a lookup with this formula:
    =LOOKUP(2^15,SEARCH(G$4:G$9,B4),G$4:G$9)

  4. Mark Knochel says:

    I'm a simple man. I deal with Lookups (INDEX/MATCH) using job titles from Project Controls vs HR, and have to normalize the titles. Something like this example allows me to make categories:
    =IFERROR(IFERROR(IFERROR(LEFT([@[Job title]], FIND(" -",[@[Job title]])-1), LEFT([@[Job title]], FIND(" (",[@[Job title]])-1)),LEFT([@[Job title]], FIND(" /",[@[Job title]])-1)),[@[Job title]])

  5. TerryW says:

    Hi Chandoo,

    Thanks for sharing an interesting task.

    I have both a formula approach and a power-query approach.

    Power Query Approach:

    let
    Source = Excel.CurrentWorkbook(){[Name="jobs"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Job title", type text}, {"Matching Job (correct answer)", type text}, {"Your formula", type text}}),
    #"Duplicated Column" = Table.DuplicateColumn(#"Changed Type", "Job title", "Job title - Copy"),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Duplicated Column", "Job title", Splitter.SplitTextByAnyDelimiter({"-","/","("}, QuoteStyle.Csv), {"Job title.1", "Job title.2"}),
    #"Trimmed Text" = Table.TransformColumns(#"Split Column by Delimiter",{{"Job title.1", Text.Trim, type text}}),
    #"Renamed Columns" = Table.RenameColumns(#"Trimmed Text",{{"Job title.1", "Matching Job Title"}, {"Job title - Copy", "Job title"}}),
    #"Removed Other Columns" = Table.SelectColumns(#"Renamed Columns",{"Job title", "Matching Job Title"})
    in
    #"Removed Other Columns"

    By the way the jobs-sq-solution you provided may not work properly if the job titles are randomly located in Column B but not in the fashion of ABC, ABC -1, ABC /2, ABC (3) etc. So you probably want to add a step to sort the first column before expanding the source.

    Formula Approach:

    In Cell D4 enter the following array formula and drag it down.

    {=IFERROR(LEFT(B4,AGGREGATE(15,7,MATCH(ROW($40:$48),CODE(MID(B4,ROW(INDIRECT("1:"&LEN(B4))),1)),0),1)-2),B4)}

    Both my solutions are based on the assumption that the additional job descriptions are followed by specific symbols in the text string. If there are more than 50k lines of data with more than 50 different symbols used in the text string, then my solution will fail or will need more work around. Yours is pretty efficient 🙂

  6. Robert H. Gascon says:

    My non-array formula is:
    =IFERROR(LOOKUP(2,
    1/(ISNUMBER(FIND([Job title],[@[Job title]]))*
    ([Job title][@[Job title]])),
    [Job title]),[@[Job title]])

  7. silvia says:

    Hello, another option coud be:

    D3=IF(COUNT(1/ISERR(SEARCH({"-","(","/"},B3)))=3,B3,D2)

    Regards.

  8. marcin says:

    hi, my choice is:
    =IF(ISNUMBER(SEARCH([@[Matching Job (correct answer)]];[@[Job title]]))=TRUE;[@[Matching Job (correct answer)]];"")
    BR,
    M.

  9. Mike says:

    I simply made a Text Formula:

    =MID(jobs[[#CELL],[Job title]],1,LEN(jobs[[#CELL],[Matching Job (correct answer)]]))

    I hope my translation from spanish to english is OK but this Works on my woorkbook.

    Regards,

  10. NARAYAN says:

    Hi ,

    This seems to work :

    =LEFT([@[Job title]],SMALL(IFERROR(IF(1,FIND([Job title],[@[Job title]])) * LEN([Job title]),999),1))

    entered as an array formula , with CTRL SHIFT ENTER.

  11. George says:

    Hi,

    {=COUNT(FIND($B$4:$B$19,$B4))}

    Put a filter on 1 and that's your matching job.

  12. Lee T says:

    =IF(ISERR(SEARCH("Procurement A",B4)), IF(ISERR(SEARCH("Project M",B4)), IF(ISERR(SEARCH("Project O",B4)), IF(ISERR(SEARCH("Admin",B4)), IF(ISERR(SEARCH("Pers",B4)), IF(ISERR(SEARCH("General",B4)), "No Matching Job","General Manager"),"Personal Assistant"),"Administrator"),"Project Office Analyst"),"Project Manager"),"Procurement Analyst")
    Room for efficiency but the formula at least covers eventuality that there is no matching job titles 🙂

Leave a Reply