vlookup and filename returning same result on each sheet.

R

RogueSwan

Hi,

This is my first post with this group even though I have used a lot of
the postings to solve my problems, thanks.

My problem is this:

I have a workbook with about 40 sheets in it. Each sheet name is also
a reference number. I use this reference number is a vlookup formula
as follows

=VLOOKUP(VALUE(MID(CELL("filename"),FIND("]",CELL("filename"))+1,255)),List!$A$3:$G$70,COLUMN()+1,FALSE)

The problem I have with this is that each sheet has the same result.
Say I look at sheet 25, if I do a recalc then the correct answer comes
through the formula. If I then move to sheet 33 it has the same
results as sheet 25 until I do a recalc. This unfortunately then
changes sheet 25's result to the same as sheet 33. What am I missing?
 
J

JE McGimpsey

You need to include the second argument in the CELL() function - by
default it uses the last sheet calculated. Try:

=VLOOKUP(VALUE(MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,25
5)),List!$A$3:$G$70,COLUMN()+1,FALSE)
 
R

RogueSwan

Thanks for the reply, I realised about five minutes after I posted
that needed the second argument.


JE McGimpsey said:
You need to include the second argument in the CELL() function - by
default it uses the last sheet calculated. Try:

=VLOOKUP(VALUE(MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,25
5)),List!$A$3:$G$70,COLUMN()+1,FALSE)



The problem I have with this is that each sheet has the same result.
Say I look at sheet 25, if I do a recalc then the correct answer comes
through the formula. If I then move to sheet 33 it has the same
results as sheet 25 until I do a recalc. This unfortunately then
changes sheet 25's result to the same as sheet 33. What am I missing?
 
J

JE McGimpsey

next time you might consider posting a reply to your own article, then.
My post came more than an hour after yours...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top