To make things easy for users of this workbook, I've setup column J with data validation (pulling values from Sheet2) that allows for multiple selections of event types (Academic Calendar, Art Exhibits, etc).

I had to use some code to pull that off, but I found a YouTube video that walked me through it so my lack of excel coding experience didn't hold me back.

In order to import this sheet into another program, I can't have "Academic Calendar" as the Event Type, I need it's corresponding code, "et-acacal". The corresponding code is sitting in the next column over on the sheet containing my event types.

Essentially I need to replace every instance of "Academic Calendar" with "et-acacal" and "Art Exhibits" with "et-artgal" as well as the various combinations of event types like "Academic Calendar, Art Exhibits" with "et-acacal, et-artgal"

I've figured out a really crappy way to pull this off, by using multiple SUBSTITUTE functions (see below), but it was tedious to set up and I have to believe there's an easier way to do this. I only had 30ish different event types, what happens if I had/have 100 or 200?


The best way to manage this is using the VLOOKUP function. This will look up the relevant event code for a event name in cell J2.


However, you have the added complication of multiple criteria in the same cell. To achieve a VLOOKUP on multiple criteria in the same cell would require you to replace one overly complicated nested SUBSTITUTE function with another - given that's why you're asking, I won't go into how that works (lots of unwieldy IFs,MIDs and SEARCHes).

Your best bet is to try and reorganise your spreadsheet so you're not trying to get all your criteria into a single cell. Excel isn't really built to do that - the cell is meant to be the most basic unit (hence the name). Try and use multiple columns and do VLOOKUPs for each one.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.