Vlookup Indirect?

fanboy

Board Regular
Joined
Feb 9, 2008
Messages
59
Hi all

I'm sure this is a pretty simple question but I cant seem to get my head round the answer.

I want to use VLOOKUP to search for values on various tabs in a workbook. I want the tab that is searched to be conditional on the contents of a cell on the summary tab. I have the following formula

=IF(BVA!O$13>0,SUMIF(BVA!$D:$D,'Spend v budget'!$B3,BVA!O:O),IF('CB May'!$J$4>0,SUMIF('CB May'!$H:$H,'Spend v budget'!$D3,'CB May'!$J:$J)-SUMIF('CB May'!$H:$H,'Spend v budget'!$D3,'CB May'!$I:$I),SUMIF('Cash forecast'!$B:$B,'Spend v budget'!$B3,'Cash forecast'!J:J)))

I want all references to 'CB May' to be whatever the contents of cell M1 are.

Can anyone help?
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,855
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows
well it's OK to use INDIRECT but it should specify the whole reference, not only the sheet name:
INDIRECT("'"&M1&"'!$J$4")
 

PCRIDE

Well-known Member
Joined
Jan 20, 2008
Messages
892
If the data is in the same location on each tab I know this can be done (See Mr Excel on Youtube) Vlookup on multiple tabs

Seems that your formulas would work, just need to add the vlookup, but you are using SUMIF so I am not sure what your trying to use the Vlook up for.
 

scottylad2

Well-known Member
Joined
Feb 2, 2009
Messages
1,919
if your sheet tabs are consecutive, say sheet 1 through to sheet 3, you can reference them all in a formula by holding down the shift key after you've selected the data on sheet 1, then clicking sheet 3. in the below example the same datas housed in the same cells on the 3 sheets

Excel Workbook
C
215
315
415
515
615
7225
Sheet1
 

PCRIDE

Well-known Member
Joined
Jan 20, 2008
Messages
892

ADVERTISEMENT

Yes thats what the video was about, multiple SHeets.

You can also create 2 tabs, Start and End tab, then any tabs inserted in the range will always be included.

=SUM(StartSheet:EndSheet!C2:C6)
 

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,855
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows
Just to make it clear for you:
=IF(BVA!O$13>0,SUMIF(BVA!$D:$D,'Spend v budget'!$B3,BVA!O:O),IF(INDIRECT("'"&M1&"'!$J$4")>0,SUMIF(INDIRECT("'"&M1&"'!$H:$H"),'Spend v budget'!$D3,INDIRECT("'"&M1&"'!$J:$J"))-SUMIF(INDIRECT("'"&M1&"'!$H:$H"),'Spend v budget'!$D3,INDIRECT("'"&M1&"'!$I:$I")),SUMIF('Cash forecast'!$B:$B,'Spend v budget'!$B3,'Cash forecast'!J:J)))
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,718
Messages
5,833,292
Members
430,203
Latest member
rmlnlo

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
Top