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?
 

Some videos you may like

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,343
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,343
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)))
 

Watch MrExcel Video

Forum statistics

Threads
1,108,450
Messages
5,523,065
Members
409,495
Latest member
bkahn

This Week's Hot Topics

Top