indirect reference to refer to cell

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,561
Office Version
  1. 2021
Platform
  1. Windows
I have the following formula below


=LOOKUP(2,1/((B$1='C:\My Documents\[Sales.2020.2021.xls]Mar-2021'!$B$7:$B$40)*($F$1=EOMONTH('C:\My Documents\[Sales.2020.2021.xls]Mar-2021'!$M$1,0))),'C:\My Documents\[Sales.2020.2021.xls]Mar-2021'!$H$7:$H$40)/0.15

I have the month and year on sheet "summary' in cell D1

i would like to make use of the indirect formula , so that when the month and year in D1 changes to say Apr-2021 , the sheet on the workbook will charge to refer to the month and the year

for e.g. id D1 is changed to Apr-2021 the workbook in the lookup formula to chnge to

Code:
 'C:\My Documents\[Sales.2020.2021.xls]Apr-2021'!$B$7:$B$40

your assistance is most appreciated
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Is D1 text or a proper date formatted to show mmm-yyyy?
 
Upvote 0
Hi Fluff

D1 is proper date formatted to show mmm-yyyy
 
Upvote 0
Ok, try it like
Excel Formula:
LOOKUP(2,1/((B$1=INDIRECT("'C:\My Documents\[Sales.2020.2021.xls]"&TEXT(D1,"mmm-yyyy")&"'!$B$7:$B$40"))
 
Upvote 0
Thanks Fluff

I tried to complete the rest of the formula using Indirect but get #n/A

Code:
 =LOOKUP(2,1/((B$1='C:\My Documents\[Sales.2020.2021.xls]Mar-2021'!$B$7:$B$40)*($F$1=EOMONTH('C:\My Documents\[Sales.2020.2021.xls]Mar-2021'!$M$1,0))),'C:\My Documents\[Sales.2020.2021.xls]Mar-2021'!$H$7:$H$40)/0.15


If you need sample data, I will post this on Drop box tomorrow
 
Upvote 0
It would help if you posted your modified formula with the indirect.
 
Upvote 0
You have some of the brackets in the wrong place try
Excel Formula:
=LOOKUP(2,1/((D$1=INDIRECT("'C:\My Documents\[sales.2020.2021.xls]"&TEXT($F$1,"mmm-yyyy")&"'!$B$7:$B$40"))*($F$1=EOMONTH(INDIRECT("'C:\My Documents\[sales.2020.2021.xls]"&TEXT($F$1,"mmm-yyyy")&"'!$M$1"),0))),INDIRECT("'C:\My Documents\[sales.2020.2021.xls]"&TEXT($F$1,"mmm-yyyy")&"'!$H$7:$H$40")/0.15)
 
Upvote 0
Hi Fluff

Many thanks for the help. It works perfectly. Will watch one or two YouTube Videos on Indirect function to get a better understanding
 
Upvote 0

Forum statistics

Threads
1,214,896
Messages
6,122,132
Members
449,066
Latest member
Andyg666

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