Home

Combining IF and INDEX functions

%3CLINGO-SUB%20id%3D%22lingo-sub-481764%22%20slang%3D%22en-US%22%3ECombining%20IF%20and%20INDEX%20functions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-481764%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%20departments%20and%20codes.%20Something%20like%3C%2FP%3E%3CP%3ECode%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BDepartment%3C%2FP%3E%3CP%3EHOL%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Holding%3C%2FP%3E%3CP%3EMAN%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BManufacturing%3C%2FP%3E%3CP%3ESAL%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BSales%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20like%20to%20have%20a%20function%20with%20arguments%20to%20input%20with%20code%20and%20return%20with%20department.%20How%20can%20I%20do%20this.%26nbsp%3B%20Thanks%20all.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-481764%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFunction%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-481904%22%20slang%3D%22en-US%22%3ERe%3A%20Combining%20IF%20and%20INDEX%20functions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-481904%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3BThanks%20for%20your%20reply.%20This%20could%20do%20for%20me%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-481850%22%20slang%3D%22en-US%22%3ERe%3A%20Combining%20IF%20and%20INDEX%20functions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-481850%22%20slang%3D%22en-US%22%3E%3CP%3EThat's%20for%20PowerShell%2C%20right%3F%20The%20switch%20statement%20might%20be%20a%20good%20fit%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fmicrosoft.powershell.core%2Fabout%2Fabout_switch%3Fview%3Dpowershell-6%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fmicrosoft.powershell.core%2Fabout%2Fabout_switch%3Fview%3Dpowershell-6%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Hans van Deursen
Occasional Contributor

Hi,

 

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
Highlighted

That's for PowerShell, right? The switch statement might be a good fit: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_switch?view...

 

 

Highlighted

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

Related Conversations
Serverless Compute Survey
MacKenzie997 in Compute on
0 Replies
multiple cells into 1
rwb20141380 in Excel on
2 Replies
how can i print file name by default for all excel sheets?
ashish0594 in Excel on
3 Replies