0
votes

I'm trying to use the excel vlookup function to search for values in a table which is created using references to other cells in other sheets. Each cells searched has a reference to other cell in another sheet, as shown in red below:

Table used to lookup greyhound stats data

In this table, i named the table as statistics and, for test, i named greyhound runs as the same. I also created other sheet for looking up for greyhound stats as shown below:

VLookUp Sheet

However, when i use Vlookup (PROCV in portuguese) to search in the greyhound column, i get a "value not available" error message (also in portuguese), as you can see on the image.

So, how can i get the greyhound data by its name, which is in fact just referenced by the cell and isn't really there?

1
vlookup expects a column number as a third parameter. Right now, you're giving it a range. Change Runs to 2 and it will worknutsch
Wrong. I named the runs column as runs. If i put the reference to the cell specified in the first image (TheBest!A2) it works perfecly, but I can't search by the dog's name.thiggy01

1 Answers

1
votes

VLOOKUP is your real problem here :D

But, assuming that you want to use VLOOKUP, you've defined your ranges wrong, and @nutsch is correct:

=VLOOKUP(B1,Sheet1!A:H,2,FALSE)

or

=VLOOKUP(B1,[Statistics],2,FALSE)

if [Statistics] is defined as the entire table. You must use "2" to call for the "runs" because that's how VLOOKUP works (it counts the number of Columns in the array you define - it doesn't care what you name things).

Now, say you're tired of using column numbers and you WANT to use your ranges. Then we look at Index/Match.

Index/Match

Index() is going to help us find our answer, while Match() helps us do the matching part. In cell TheBest!B2, you'd put:

=INDEX(Sheet1!B:B,MATCH(B1,Sheet1!A:A,0))

or

=INDEX([Runs],MATCH(B1,[Greyhound],0))

if you're using named ranges (where [Greyhound] is Column A in the first screen shot and [Runs] is Column B in the same screenshot.) The 0 in the Match equation is how we find the EXACT match as well.

Interestingly, I note that your output sheet is just turning the data on its side. You could use a PivotTable here, or you could even design a single equation that would work for all cells with Index/Match/Match.

Index/Match/Match

Index() can let you define the rows as well as the columns, so let's do that too!

=INDEX(Sheet1!A1:H100,MATCH(B$1,Sheet1!A:A,0),MATCH($A2,Sheet1!1:1,0))

or, if I'm assuming that [Statistics] is the whole table and [Greyhound] is Column A and [Headers] is Row 1,

=INDEX([Statistics],MATCH(B$1,[Greyhound],0),MATCH($A2,[Headers],0))

You could drag this equation down B2:B8 on your reporting page and it should work fine, regardless of which dog is shown in B1.

None of this should care if your Statistics array is referencing the dog name with =Top50Graded!A3.