Search code examples
excelreferencerefworksheetvlookup

Excel VLOOKUP #REF Error


I'm trying to create an integrated athletic planning and training calendar. Part of this is for one sheet to identify weeks in which races occur based upon races and dates identified by the user on another sheet. I've confirmed that my VLOOKUP is not referencing a non-existent column and that the cell style is General for those applicable.

Here is the formula:

=VLOOKUP(Periods!A6,Races!$F$2:$F$20,2,FALSE)

Image of the formula worksheet Image of the target worksheet

The Lookup Value is the Training week on the first image and is used to identify races on the target worksheet. Each row on that sheet has a different training week. I am trying to get Column D (and F) on the formula sheet to show the priority of the race if there is one planned for the applicable week.

Any help is appreciated.

Thanks!

Mike


Solution

  • the ,2, in your vlookup here =VLOOKUP(Periods!A6,Races!$F$2:$F$20,2,FALSE) means go to the right of column F2:F20 if a match is found in column F, but, you need to specify F2:G20 for that to work in your vlookup formula. (which still won't give you the results you are expecting)

    You have two options,

    Option 1: reorganize your target worksheet so your lookup value is on the left, so you can use vlookup to pull columns to the right of it

    Option 2, use a different kind of formula like a Match + index combination. (untested, but example below)

    =Index(Races!$B$2:$B$20,match(Periods!A6,Races!$F$2:$F$20,0))