# Thread: VLOOKUP Fails Thanks:  2 Post #5311425 (1)Post #5311427 (1) Likes:  2 Post #5311425 (1)Post #5311427 (1)

1. ## VLOOKUP Fails

I've built a timesheet with 15-minute increments. Users enter their task and what project the task is part of, and a single project can have multiple tasks. All projects are in one column and all tasks are in a neighboring column. Total time is listed beside them. The range is D2:G166 (NOTE: Column F is a notes column and has no value for the purposes of the summary table). The sheet is named "Detail". See example below:

I've been using the timesheet for nearly a year now and it works fine, but I've decided it's time to create a summary page for it on a different sheet. My first step was to create a list of unique tasks using an array formula:

Code:
`{=IFERROR(INDEX(Detail!\$D\$2:\$D\$166,MATCH(0,COUNTIF(\$A\$1:A1,Detail!\$D\$2:\$D\$166),0)),"")}`
This formula was then drag-copied down over the range A2:A167 and works fine.

Next, I created an Hours column that determines how much time is paid to each individual task, regardless of where it appears in the original table:

Code:
`=IF(OR(A2="",A2=0),"",SUMIF(Detail!\$D\$2:\$D\$166,A2,Detail!\$G\$2:\$G\$166))`
The formula uses the result of the previous formula as the criteria for the SUMIF to locate the appropriate numbers to sum up. This too works just fine across the range C2:C167.

Now we get to the problem. In column B, I created a formula that would determine what project each task was assigned to:

Code:
`=IFERROR(VLOOKUP(A2,Detail!\$D\$2:\$E\$166,2),"")`
Like the previous formula for summing hours, this one is referencing the result of the first formula as the VLOOKUP lookup value. But instead of doing that, it targets seemingly random tasks. I can't figure out why it would do that, but I've determined that all values are correct as I understand VLOOKUP—and I should understand it, as I use it frequently. Is it because the first formula is an array formula? If that's a problem, why does the SUMIF formula work fine when the VLOOKUP doesn't? I am thoroughly confused and can't seem to locate any information on this particular problem in my online searches, so here we are.

The final summary table is meant to look like the below (using the example table above as a reference):

2. ## Re: VLOOKUP Fails

the extra ,0 forced an exact match

=IFERROR(VLOOKUP(A2,Detail!\$D\$2:\$E\$166,2,0),"")

3. ## Re: VLOOKUP Fails

If your list isn't sorted, you need to specify an exact match
=IFERROR(VLOOKUP(A2,Detail!\$D\$2:\$E\$166,2,0),"")

4. ## Re: VLOOKUP Fails

That fixed it! Now I feel silly for neglecting it. Thanks!

5. ## Re: VLOOKUP Fails

Glad we could help & thanks for the feedback

6. ## Re: VLOOKUP Fails

no worry.
we all done it before