Lookup Function not working

H

hcamelion

Here is my function:

=LOOKUP(A18,'Week 1 Totals'!A18:A94,'Week 1 Totals'!J18:J94)

For some reason this is not working for me. I am trying to find a
total number of hours worked for a given job. A18 is a job number.
A18:A94 on week 1 totals sheet is a range where the job numbers are
located for each job. J18:J94 on week 1 totals sheet is where the
total hours are for each job. For some reason this function is
returning 0 even though J18 = 1 where A18 on the current sheet matches
A18 on the week 1 totals sheet. So it should return 1. I cant figure
out why its not working. Any one know why.
 
P

paul

vlookup is better =vlookup(A18,'Week 1 Totals'!A18:J94,10,false)
i cant count so you might have to play with the col num (10)
 
H

hcamelion

That worked great but there is one problem: Week 1 Totals sheet may o
may not have the job # I am calling as only jobs that were worked tha
week show up on that sheet. When vlookup does not find th
corrosponding job number it returns #N/A. I need it to return 0 whe
the job is not on the week 1 totals sheet. Any ideas. I tried doin
an if...if the vlookup = #N/A display 0 if not display the vlooku
result. But I guess that doesnt work with errors. Any ideas
 
E

edwardpestian

Use ISERROR

=IF(ISERROR(VLOOKUP(A18,'Week
Totals'!A18:J94,10,FALSE)),0,VLOOKUP(A18,'Week
Totals'!A18:J94,10,FALSE))

-e
 
Top