Forum Discussion

C45_2022's avatar
C45_2022
Copper Contributor
Jun 23, 2022
Solved

If function in excel

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.

  • 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's avatar
    mathetes
    Silver Contributor

    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"

     

    • C45_2022's avatar
      C45_2022
      Copper Contributor

      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.

Resources