Forum Discussion

amiller2325's avatar
amiller2325
Copper Contributor
Feb 05, 2020

Help with VLOOKUP on different worksheets

I need help using the VLOOKUP formula.  I have a source data worksheet Columns A,B,C are Product Code, Product Description, Product Cost respectively. In the next worksheet I have a table with the same column headers, also column A,B,C.  On this worksheet, Column A will have the product code manually typed in i.e. 123456.  The Vlookup formula will be used in Column B to lookup on the source worksheet the product description in Column B that corresponds with the code typed in Column A.  I have created a range name for my source worksheet of MasterCostData.  I would then use same formula syntax to populate the cost for the code typed in in to column C.

 My formula in Column B is =VLOOKUP(A2,MasterCostData,2,FALSE) and I keep getting a N/A error.  HELP!!

 

 

 

My formula

 
 

 

 

 

with 3 columns - Column 1 product code, Column 2 product description and Column 3 cost.  I am trying to write the VLOOKUP formula so that on a different worksheet I can physically type the Product code in a cell and one cell to the right the product description will populate from the source worksheet.  And then again write the formula so that I can populate the cost based on the product code entered in a cell to the right of the product description.

 

For example, I have created a range name of "MasterCostData" for the data from my source worksheet.  I have the same  table headers as my source data (Column 1 product code, Column 2 product description and Column 3 cost).  If I type in a product code of 123456 in cell A9 of the Product Code column< I want Excel to Look for that value in the same column of my source worksheet (MasterCostData) and populate the product description for that code in the Product Description column.. So, in the Product description column I have typed =VLOOKUP(A9, MasterCostData,2,0).  I continuously get a N/A Error message.

 

HELP!!

5 Replies

  • ChrisMendoza's avatar
    ChrisMendoza
    Iron Contributor

    amiller2325 -

     

    Your values in [CODE] Named Range = 'MasterCostData' are stored as Text. The data entry in $A$2 is General however, the value 110161 is understood to be Number.

     

    Therefore, 110161 <> '110161'.

     

     

  • amiller2325's avatar
    amiller2325
    Copper Contributor

    Sorry very confusing - I forgot to delete the last part of the post.  Please only respond to first paragraph.

    • mathetes's avatar
      mathetes
      Gold Contributor

      amiller2325I see the problem just looking at your sheets. The code in your master data sheet is in text form; in your other page its numeric. That's an easy mistake to make, but I'm quite sure that's the issue.

       

      FWIW, the named range for the master data was not as simple as it could have been....