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

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

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)))
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,759
Messages
5,513,233
Members
408,941
Latest member
jackson1478

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top