Using sheet name in VLOOKUP Lookup_Value

Helky

New Member
Joined
Sep 19, 2023
Messages
2
Office Version
  1. 365
I have one sheet with a list of information. First cell is 1,2,3,4,... etc. Then I have multiple sheets looklike form and I need to get information from that first sheet. All other sheets are named 1, 2,3 etc. so sheet 1 should get information frome row 1.

I can get sheet name using formula =RIGHT(CELL("filename");LEN(CELL("filename"))-FIND("]";CELL("filename"))) but if I use that in VLOOKUP, for example =VLOOKUP(RIGHT(CELL("filename");LEN(CELL("filename"))-FIND("]";CELL("filename")));'Sheet1'!A:Z;7;FALSE) i recieve #N/A. What's wrong? If I use =VLOOKUP(A1;CELL("filename")));'Sheet1'!A:Z;7;FALSE) I recieve data correctly.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Welcome to the Forum!

Your formula works OK for me. Are you sure that your list of sheet names in Sheet1 exactly matches each sheet name, e.g. no leading or trailing space characters?

By the way, with Excel 365, you can get the sheet name using a simpler formula: =TEXTAFTER(CELL("filename"),"]")
 
Upvote 0
Solution
Thanks for that textaftercell =) . Now I actually changed numbers to letters a,b,c,d and using that it worked. Somehow those numbers did not work..
 
Upvote 0
Sorry, I should have realised. Your sheet name is "1", i.e. a string. If you are comparing to a numeric 1, then the VLOOKUP will return #N/A.

A1 below is text. B1 is numeric.

ABC
111FALSE
1
Cell Formulas
RangeFormula
A1A1=TEXTAFTER(CELL("filename"),"]")
C1C1=A1=B1
 
Upvote 0

Forum statistics

Threads
1,215,108
Messages
6,123,128
Members
449,097
Latest member
mlckr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top