SOLVED

If function in excel

%3CLINGO-SUB%20id%3D%22lingo-sub-3543336%22%20slang%3D%22en-US%22%3EIf%20function%20in%20excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3543336%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20%3CSTRONG%3Ecolumn%20A%3C%2FSTRONG%3E%20on%20%3CSTRONG%3Esheet%201%3C%2FSTRONG%3E%20with%20item%20codes%2C%20%3CSTRONG%3Ecolumn%20B%3C%2FSTRONG%3E%20on%20%3CSTRONG%3Esheet%201%3C%2FSTRONG%3E%20with%20item%20descriptions.%3C%2FP%3E%3CUL%3E%3CLI%3EOn%20%3CSTRONG%3Ecolumn%20B%3C%2FSTRONG%3E%20on%20%3CSTRONG%3Esheet%202%3C%2FSTRONG%3E%2C%20I%20would%20like%20to%20use%20if%20function%20so%20I%20can%20type%20any%20description%20on%20any%20cell%20which%20will%20give%20column%20A%20on%20sheet%202%20its%20code.%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20assist.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3543336%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3544048%22%20slang%3D%22en-US%22%3ERe%3A%20If%20function%20in%20excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3544048%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1434016%22%20target%3D%22_blank%22%3E%40C45_2022%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere's%20a%20formula%20that%20does%20what%20I%20think%20you're%20describing.%20If%20I%20interpreted%20you%20incorrectly%2C%20please%20come%20back%20with%20a%20more%20complete%20description.%20see%20the%20attached%20workbook%20as%20well%3C%2FP%3E%3CP%3E%3DXLOOKUP(B2%2CSheet1!%24B%242%3A%24B%245%2CSheet1!%24A%242%3A%24A%245%2C%22NA%22%2C0)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBe%20aware%20though%20that%20this%20only%20works%20for%20descriptions%20that%20are%20valid%3B%20not%20%22any%20description%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3546841%22%20slang%3D%22en-US%22%3ERe%3A%20If%20function%20in%20excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3546841%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F425987%22%20target%3D%22_blank%22%3E%40mathetes%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20liked%20the%20way%20you%20understand%20and%20interpret%20my%20problem%20so%20well%20even%20though%20I%20did%20not%20give%20a%20concise%20explanation%3CBR%20%2F%3E%3CBR%20%2F%3EI%20copied%20the%20formula%20and%20pasted%20it%20and%20it%20worked.%3CBR%20%2F%3E%3CBR%20%2F%3ELove%20your%20understanding%20of%20formulas%2Ffunction.%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20allot.%20So%20helpful.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I have column A on sheet 1 with item codes, column B on sheet 1 with item descriptions.

  • On column B on sheet 2, I would like to use if function so I can type any description on any cell which will give column A on sheet 2 its code.

 

Please assist.

2 Replies
best response confirmed by Sergei Baklan (MVP)
Solution

@C45_2022 

 

Here's a formula that does what I think you're describing. If I interpreted you incorrectly, please come back with a more complete description. see the attached workbook as well

=XLOOKUP(B2,Sheet1!$B$2:$B$5,Sheet1!$A$2:$A$5,"NA",0)

 

Be aware though that this only works for descriptions that are valid; not "any description"

 

@mathetes 

I liked the way you understand and interpret my problem so well even though I did not give a concise explanation

I copied the formula and pasted it and it worked.

Love your understanding of formulas/function.

Thanks allot. So helpful.