REF error with INDIRECT formula

colinheslop1984

Board Regular
Joined
Oct 14, 2016
Messages
102
Hi

Hoping someone can help, I need to gather data from multiple worksheets on multiple workbooks

The below gives me #REF error

=SUMPRODUCT(INDIRECT("'"&$C$5&"'[JAMIE SHEET METRO.xlsx]!'""'c$12:c$25"),$C$9:$C$22,INDIRECT("'"&$C$5&"'[JAMIE SHEET METRO.xlsx]!J$12:J$25"))

Cell C5 refers to tab names which can be changed using a drop down list
c12:c25 is criteria
j12:j25 is data needed

Is my formula structured wrong or is a different one needed?

Any feedback and possible suggestions would be much appreciated
 

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
7,776
Office Version
365
Platform
Windows
Workbooks come before sheet names not the other way round as you have it.
 

colinheslop1984

Board Regular
Joined
Oct 14, 2016
Messages
102
=SUMIF(INDIRECT("'"&$C$5&"[JAMIE SHEET METRO.xlsx]'!'""'c$12:c$25"),$C$9:$C$22,INDIRECT("'"&$C$5&"[JAMIE SHEET METRO.xlsx]'!J$12:J$25"))

Still get the same error, have I put in in the right place amongst those quotation marks?

Would be a big help if you could rewrite for me, im not that savvy with all this

Thanks for help !
 
Last edited:

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
7,776
Office Version
365
Platform
Windows
Do the sumif without the indirect and paste that formula here. Ill rewrite it for you.
 

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
7,776
Office Version
365
Platform
Windows
Hold on ive just read it again. What do you mean c12:c25 is criteria?
 

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
7,776
Office Version
365
Platform
Windows
Lets start from the start. What is it you are trying to calculate?
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,007
Office Version
365
Platform
Windows
This has been cross posted on at least one other site
While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.

Please supply links to all other sites where you have asked this question.
 

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
7,776
Office Version
365
Platform
Windows
Here is a valid sumif using indirect:

=SUMIF(INDIRECT("'[JAMIE SHEET METRO.xlsx]"&$C$5&"'!C$12:C$25"),$C$9,INDIRECT("'[JAMIE SHEET METRO.xlsx]"&$C$5&"'!J$12:J$25"))

This is going to sum the numbers in range J12:J25 of the sheet named in cell C5 of the Jamie workbook where the corresponding cells in C12:C25 equal whatever is in C9.
 

Forum statistics

Threads
1,081,577
Messages
5,359,731
Members
400,545
Latest member
Damntheman30

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top