Solved

Referencing a sheet via cell

Posted on 2013-06-25
4
224 Views
Last Modified: 2013-06-25
I want to  set up a vlookup within a workbook and I want to be able to pick my worksheet based on a date in cell A2.  The range will always be the same but the worksheet I am referencing will be dynamic based on the date in A2.  this is the formula +IFERROR(VLOOKUP(E$3,'16-Jun-2013'!$B$31:$O$78,MATCH($B11,'16-Jun-2013'!$B$3:$O$3,0),0),0)
0
Comment
Question by:Jenedge73
  • 2
4 Comments
 
LVL 12

Expert Comment

by:telyni19
ID: 39276078
I suggest using the Indirect formula with a Text format of the date in cell A2. Try this:
=IFERROR(VLOOKUP(E$3,INDIRECT(TEXT(A2,"dd-mmm-yyyy")&"!$B$31:$O$78",MATCH($B11,INDIRECT(TEXT(A2,"dd-mmm-yyyy")&"!$B$3:$O$3",0),0),0)
0
 

Author Comment

by:Jenedge73
ID: 39276163
All my worksheets are named DD-MMM-YYYY and in cell A2 I have a date.  I had to add parentheses to the formula however I keep getting a Ref error any ideas?=VLOOKUP(E$3,INDIRECT(TEXT(A2,"dd-mmm-yyyy")&"!$B$31:$O$78"),MATCH($B4,INDIRECT(TEXT(A2,"dd-mmm-yyyy")&"!$B$3:$O$3"),0),0)
0
 
LVL 12

Accepted Solution

by:
telyni19 earned 500 total points
ID: 39276175
Try adding single quotes around the sheet names, then:
=VLOOKUP(E$3,INDIRECT("'"&TEXT(A2,"dd-mmm-yyyy")&"'!$B$31:$O$78"),MATCH($B4,INDIRECT("'"&TEXT(A2,"dd-mmm-yyyy")&"'!$B$3:$O$3"),0),0)
0
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 39276183
=VLOOKUP(E$3,INDIRECT(TEXT(A2,"dd-mmm-yyyy")&"!$B$31:$O$78"),MATCH($B4,INDIRECT(TEXT(A2,"dd-mmm-yyyy")&"!$B$3:$O$3"),0),0

Should $B4 be $B11 (as per your original question)?
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question