Combining IF and INDEX functions

Occasional Contributor



We have departments and codes. Something like

Code     Department

HOL      Holding

MAN     Manufacturing

SAL       Sales


I would like to have a function with arguments to input with code and return with department. How can I do this.  Thanks all.

2 Replies

That's for PowerShell, right? The switch statement might be a good fit:



@Vasil Michev Thanks for your reply. This could do for me