Forum Discussion

Testbot1's avatar
Testbot1
Copper Contributor
Jul 25, 2023
Solved

Vlook up Error

Hi Community, 

I'm trying to do a vlookup to capture  the values from my second sheet( Values). This is the formula I used below. Ideally, I want the C column on the master sheet to read Rejected, Approved, Cancelled or Error

Steps taken
I selected cell A2( In the Master Sheet), Click the Values sheet and selected all the values, I clicked F4, Then 2, False

=VLOOKUP(A2,Values!$A$1:$B$4,2,FALSE)

 

 

 

  • Testbot1 The lookup values (column A on the Master sheet) are a mix of texts and numbers. Text "17" is not equal to number 17, hence #N/A#

     

  • mathetes's avatar
    mathetes
    Silver Contributor

    Testbot1 

    First, you will need to reverse the order of the table being used for looking up those possible returns, so it begins with the lower numbers, and you want the bottom (lowest) number to be zero

    0Out of range
    3Error
    15Cancelled
    16Approved
    17Rejected

     

    Then, if the only numbers that are ever going to appear in column A are the ones in the table) your formula should work. Otherwise, for a range lookup, you would want the final word in that formula to be "True"

    =VLOOKUP(A2,Values!$A$1:$B$4,2,TRUE). or, I always find it easier to use 1 or 0, as in

    =VLOOKUP(A2,Values!$A$1:$B$4,2,1)

     

    • Testbot1's avatar
      Testbot1
      Copper Contributor
      Thank you! This and the combination of response above solve the issue
  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    Testbot1 The lookup values (column A on the Master sheet) are a mix of texts and numbers. Text "17" is not equal to number 17, hence #N/A#

     

Resources