Indirect Formula

lizemi

New Member
Joined
Sep 5, 2021
Messages
28
Office Version
  1. 365
Platform
  1. Windows
Hi
I have a workbook with sheets named Week 1 - Week 52 (52 Sheets)
On a different workbook I need to vlookup from my weekly sheets to create a summary
I am trying the indirect formula to tell excel what week nr sheet to use so that I can use one formula for all 52 weeks on my summary, but it is giving me an error.

Basically I whant to tell excel that the sheet nr is b3,c3,,d3,e3 etc
1711610485285.png
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
you are looking up another workbook ?
also indirect uses the & to add
so maybe
vlookup($a4,indirect("filename"&B3&"range"),2,false)
but you need to make sure you include the ' and the !

in a simple example using a sheet
=VLOOKUP(A4,INDIRECT(B3&"!$A$1:$B$10"),2,FALSE)

summary with Indirect on
Book11
ABC
1
2
3sheet2sheet3
4asheet2a-1sheet3a-1
5bsheet2a-2sheet3a-2
6csheet2a-3sheet3a-3
Sheet1
Cell Formulas
RangeFormula
B4:C6B4=VLOOKUP($A4,INDIRECT(B$3&"!$A$1:$B$10"),2,FALSE)


sheet2
Book11
AB
1
2asheet2a-1
3bsheet2a-2
4csheet2a-3
Sheet2


Sheet3
Book11
AB
1
2
3asheet3a-1
4bsheet3a-2
5csheet3a-3
Sheet3
 
Upvote 0
Basicly:
=VLOOKUP($A4,'Week 40'!$A:$B,2,0)

Same result, put the range inside INDIRECT:
=VLOOKUP($A4,INDIRECT("'Week 40'!$A:$B"),2,0)

with B3="Week 40", split the INDIRECT into 3 parts, wrap anything with "":
INDIRECT("'" & B$3 & "'!$A:$B")

final formula:
Code:
=VLOOKUP($A4,INDIRECT("'" & B$3 & "'!$A:$B"),2,0)
 
Upvote 0
You can't use indirect on a closed workbook it will give a #REF! error.
Some options are:
• Use VBA to change the formula to the correct sheet name
• Pull in the data for all worksheets into the current workbook using Power Query and use the imported data in your Vlookup
 
Upvote 0
Hi Sorry I still don't seem to get it to work.

If I use
=VLOOKUP($A2,INDIRECT("'C:\Users\Lize\Desktop\[Test Week.xlsx]"&B1&"'!$A:$B"),2,FALSE)
It gives me a #REF error

=VLOOKUP($A2,'C:\Users\Lize\Desktop\[Test Week.xlsx]Week 40'!$A:$B,2,FALSE) is the formula that works but without the indirect obviously
 
Upvote 0
is the other workbook "test week.xlsx " - OPEN

as mentioned needs to be open

B1 - you have B3 in the image not B1
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,191
Members
452,616
Latest member
intern444

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