# Using Sumif And Indirect To Reference Another Worksheet

Oct 15, 2013

I am trying to use the sumif and indirect function together but I keep getting an error and I'm not sure why.

Actual formula:
=SUMIF('SWG OR'!B:B,A168,'SWG OR'!E:E)

Using the sumif/indirect function, I have the following:
> Cell B5 contains the name of the tab "SWG OR"
=sumif(indirect(B5&"!B:B",A168,B5&"!E:E"))

## Worksheet Reference In Indirect Function

Feb 22, 2010

I have a worksheet with a name that inckudes a hyphen, e.g. 1234-5678.
And I have the worksheet name in a cell, say, I!.

Using

I get a REF error because of the inclusion of the hyphen in the worksheet name.

How can I fix this without eliminating the hyphen?

## INDIRECT - Sum Contents Of Column On Another Worksheet Up To Certain Cell Reference

Jan 24, 2012

Trying to use INDIRECT to sum the contents of a column on another worksheet upto a certain cell reference which is in another cell on the worksheet.

=SUM(INDIRECT("Sheet1!A4:Sheet1!"&B1))

I have taken it back to simply having sheet1 with numbers in A4 to A23, then sheet2 with A23 in cell B1, and the formula above it C9, but I keep getting #REF!.

The formula works fine if on sheet1 without the worksheet names in it. Formula evaluation gets to =SUM(INDIRECT("Sheet1!A4:Sheet1!A23")) then gives =SUM(#REF!)

## Sumif - Reference To Cell On Another Worksheet

Feb 27, 2007

I'm trying to reference a cell on another worksheet in my criteria and the formula doesn't seem to be working. All I get is a value of 0.

= SUMIF(G3:G76, ">='City Wide'!B6",I3:I76)

If I replace 'City Wide'!B6 with an actual number the formula works. This does not help as 'City Wide'!B6 is a value that can change.

## Too Many Instances Of "INDIRECT": Reference One Worksheet From Another

Apr 4, 2009

I only dabble with Excel occasionally, but whenever I do, boy, do things get ambitious. Now I've run into a bit of a brick wall trying to reference one worksheet from another, with the specific worksheet referenced being variable (it looks for the worksheet name in cell D3).

I formerly had this, the "hard-coded" version:

=SUM('2009'!F4:OFFSET('2009'!F4,(MATCH(B3,'2009'!A4:A15,0)-1),0,1,1))

I want to replace "2009" with the lovely and helpful INDIRECT function, and have managed to get to this point:

=SUM('2009'!F7:OFFSET(INDIRECT(D3&"!F7"),(MATCH(B3,INDIRECT(D3&"!A7:A18"),0)-1),0,1,1))...........

## SUMPRODUCT INDIRECT & SUMIF Formula

Jul 12, 2006

I have a set of data as attached where the productivity of each staff is recorded on a daily basis.However, the cell in which their name is located on each tab of the day of the month might not be the same. I am thankful that the forum actually provided me with the formula located in cell c15.

1)However, I would appreciate if someone could translate what the formula means as I am not so sure what the formula represents.

2)The reason is I would like to calculate how many training days (TR), Medical Leave(ML) and Emergency Leave(EL) for the month of January for each staff.I tried modifying the formula but it didnt work.

3) Is it possible to use a vlookup function for this solution?

## Using SUMIF And INDIRECT Multiple Times In Same Equation

Dec 9, 2013

I am trying to stream line the recording of time tickets . I would like to create a Summary sheet that shows the amount of hours each worker has done based on that particular day. The trick is I want the summary sheet to be automatically updated when the each individual time ticket sheet is completed. I would also like to be able to drag the formula across a row so I do not have to recreate the equation each time a new time ticket sheet is completed. Each time ticket sheet is its own sheet and is identified by date. Each time ticket ticket sheet is identical and is already created to so all you have to do is click on that the sheet reflecting the date and fill in the information.

This is the equation I have created but keep getting #VALUE!

=SUMIFS((INDIRECT("'"&MONTH(J\$8)&"-"&DAY(J\$8)&"-"&YEAR(J\$8)-2000&"'!\$L\$11:\$L\$34")),(INDIRECT("'"&MONTH(J\$8)&"-"&DAY(J\$8)&"-"&YEAR(J\$8)-2000&"'!\$B\$6")),('Data (2)'!J\$8),(INDIRECT("'"&MONTH(J\$8)&"-"&DAY(J\$8)&"-"&YEAR(J\$8)-2000&"'!\$C\$11:\$C\$34")),('Data (2)'!\$I\$9))

The sum_range is Manhours from L11:L34 for each time ticket sheet. The criteria_range1 is date in cell B6 listed on each time ticket sheet, criteria1 is date listed on cell J8 of the summary sheet . The criteria_range2 is names from C11:C34 for each time ticket sheet, criteria2 is name of person on cell I9 of the summary sheet.

Each sheet is labeled as 8-19-13, 8-20-13, 8-21-13, and so on. Summary sheet is labeled as Summary

The table that I am using to record the data on the summary sheet has the date increasing by one day on row 8. The names are vertically listed on column I.

## SUMIF With Two Text Based Criteria Using INDIRECT

Apr 23, 2008

I have a need to sum values in the right column of a 2 column table based on multiple criteria of the values in the left hand column. The table has 500 rows.

The two criteria are:
1 - that the cell contains a specific text string ("product a")and
2 - that the cell contains a text string for the month in question ("Jan")

The other limitation I have to work with is that the formula is in a different workbook to the source data. I have a worksheet that lists the external workbook/sheet and have been using INDIRECT in the DSUM.

I read through the examples here:
[url]

Basically they recommended DSUM as the most efficient.

I can get the DSUM working, but it needs the workbook to be open before it can evaluate the expression and therefore I get an error when I select to update values upon opening the workbook.

So in summary I wondering if anyone can show me how to write a SUMIF formula based on the above criteria.

## Excel 2010 :: SUMIF With Multiple Criteria - How To Add INDIRECT To Formula

Aug 11, 2013

Excel - 2010

I have the following formula:

=SUMIFS(FEB!TRANS_Cost,FEB!TRANS_Cat1,CAT_Main3,FEB!TRANS_Cat2,"Computer Items",FEB!TRANS_Status,"Paid")

TRANS_Cost = B:B on FEB tab
TRANS_Cat1 = C:C on FEB tab
TRANS_Cat2 = D:D on FEB tab
CAT_Main3 = "Everyday_Expenses"
TRANS_Status = E:E

In short the formula adds the total cost of anything 'tagged' as Everyday_expenses, computer items, paid. I want to adapt it so that it takes the value from a defined cell such as Month, so that data can be pulled by month.

## Indirect Reference To Defined Name

Feb 17, 2012

Reduced to it's simplest form I have a formula

=1*(FY2012_TY), where FY2012_TY

is a Defined Name which refers to a column on another tab in the workbook, and is defined as:

=OFFSET(Table!\$AA\$3,0,0,COUNT(Table!\$AA:\$AA),1)

What I would like to do is to come up with an approach to this formula that would allow me to drag it across columns and have the year automatically increment (e.g., FY2013_TY, FY2014_TY, all of which are similarly defined Defined Names referring to adjacent columns). I have tried various approaches using INDIRECT along with CONCATENATE, but when it comes down to evaluating the formula, I consistently get a #REF! error.

## Row Reference Using No Indirect Or Offset

Feb 1, 2009

I have an income statement with the cities on top (column header) and the expenses below it. There are 5 cities for example. The last line is net profit before it changes to the next city.

Wages
Lights
Net Profit

Boston
Lights
Wages
Sales
Net Profit

How do you get the row reference for Boston Net Profit without using the offset or indirect function? (doing external linking with workbook closed) The formula would find Boston first and then look for the first net profit after Boston? The small if function may work for this.

## Adding Text To INDIRECT Reference

Feb 13, 2014

Is there anyway to add text to an INDIRECT reference so that it will now reference a new range?

For instance, this is my formula...

=IF(INDEX(INDIRECT("A1+TM"),MATCH(B2,INDIRECT(A1),0),1)="","-",INDEX(INDIRECT("A1+TM"),MATCH(B2,INDIRECT(A1),0),1))

I am trying to say, if the cell 1 column to the left of the cell that matches the text in B2, in the cell range referenced in A1 (CWS) "added to the text "TM", is blank, then write "-", otherwise return the number in the cell 1 column to the left of the cell that matches the text in B2, in the cell range referenced in A1 (CWS)+"TM".

Cell A1 is a data validation list that refers to different ranges. The only difference between those named ranges and the named range I want to reference is the text "TM" comes at the end.

## Indirect Reference To Closed Workbook

Jan 17, 2008

I am writing a formula in cell "B1" in "December 2007 REVISED BY DAN.xlsm" that will reference cell "X1" in a workbook that has not been created yet.

The way I will tell the formula what the name of the workbook will be is by referencing cell "A1" and adding the extension ".xlsx" to it.

Example: ...

## Using Named Ranges Following Indirect Reference?

Feb 7, 2012

I have the following formula which i'm using to indirectly reference a worksheet. The worksheet i'm referencing includes named ranges that i'd like to call on but i can't get the syntax right.

Code:
=SUMPRODUCT(--(INDIRECT("'"&HH_Elec_Title&"'!B15:B19")>=D5),--(INDIRECT("'"&HH_Elec_Title&"'!B15:B19")

## Indirect Reference To A Separate Workbook

Jun 26, 2014

Just wondering if there is a way to indirectly reference a workbook in a formula?

For example, suppose A1 has the path/filename of the workbook I want to reference.

So in another cell I want to do, say, a VLOOKUP(A2,A1,5), where A2 is the lookup value. This way, if I have multiple workbooks I want to look at, I can specify them all in various cells, and simply have the formula look at the right cell to perform the lookup.

I've played with INDIRECT and get something close if I do

=INDIRECT("'"&A1&"'!A1:AJ1500")

but that just returns the contents of A1 in the target sheet.

## VLOOKUP - Indirect RangeName Reference

Mar 12, 2008

I'm having difficulty referencing named ranges indirectly in a VLOOKUP formula (Excel 2003).

Cell A1 contains a fuel cost.

Cell A2 contains a formula that returns a RangeName.

In Cell A3, I want to enter a VLOOKUP formula that uses the range returned as the result in Cell A2 as the Table_array. In other words: =VLOOKUP(\$A\$1,\$A\$2,2,FALSE). The result is #NA!.

If I use =VLOOKUP(\$A\$1,INDIRECT(\$A\$2),2,FALSE), I get #REF!.

Among other things, I've also tried =VLOOKUP(\$A\$1,TEXT(\$A\$2,"@"),2,FALSE). No cigar.

## Combining Text And Cell Reference With Indirect

Oct 2, 2008

I'm trying to combine text and a cell reference using Indirect. Cell B1 contains the text "Region" (no quotation marks). In another cell I'm trying to create a reference to "Region total" (no quotation marks). By my limited understanding the below should work: =INDIRECT("b1"&" total")

But the cell returns #REF!. I've tried pretty much every combination of quotation marks around different elements of the formula I can think of. Cell B1 is a drop down list, don't imagine that's relevant, but it may be.

## Sheet Cell Reference And INDIRECT Formula

Jun 9, 2009

I have this formula in excel 2007:

Blad is Dutch for sheet, by the way.

In this formula, I want to let the ranges in Sheet1 be dependent of values in Sheet2. The formula itself is in Sheet2.

W must be replaced by the value of Sheet2!B12 and X to be replaced by the value of Sheet2!B9.

I tried this by using the INDIRECT formula, but the quotation marks of the search values are giving errors.

## Dynamic Cell Reference In Indirect Formula

Oct 11, 2011

I need making a dynamic cell reference in an indirect formula, which looks at a different workbook.

The other workbook is called: ESF.xlsx
The sheet name in the other workbook is defined in Cell B2
The first cell i need to pull across is B115.

In cell B8, This is what i have so far:

=INDIRECT("[ESF.xlsx]"&B2&"!"&"B115")

How do i make it so that i can copy this formula quickly, but so only the row and column reference change?

Like in C8 i would want it to look at cell C115, In C9, id want it to look at C116 etc.

## Changing Indirect Reference When Dragging Formula

Dec 9, 2012

I have been using the following formula to do conditional summing over multiple worksheets:

=SUMPRODUCT(SUMIF(INDIRECT("'"&\$AB\$2:\$AB\$13&"'!b3:b39"),\$B16,INDIRECT("'"&\$AB\$2:\$AB\$13&"'!c3:c39")))

The formula works fine, but when I drag it to the next column c3:c39 stays the same. How do I get that reference to change when I drag the formula over multiple columns.

## Indirect Function To Reference A Named Range

Apr 30, 2009

How would I used the indirect function to reference a named range in the workbook in formula creation.

For instance, if in cell A1 I have entered the text "Sales" which is also a named range in the workbook. Then in cell A2 I tried entering the following formula to sum based on the entry in cell A1 using the indirect funtion. For instance:

=sum(indirect(A1))

In this instance I was hoping this formula would then sum the amounts in the "Sales" named range. And, if I changed the text in cell A1 to "Cost" for instance (another named range in the workbook), it would sum the amounts in the "Cost" named range. Allowing for a dynamic formula based on the entry in cell A1.

I'm using Excel 2007.

## Variable Cell Reference In INDIRECT Formula

Sep 28, 2006

I want to create a formula of the form: =INDIRECT(ADDRESS(4,2,2,TRUE,(\$A9) and insert this in a cell BUT the \$A9 reference needs to reference the row of the cell where the formula is being inserted which will vary. ie. A30, A31, etc. How do I do this?

## Increment Indirect Formula Column Reference

Dec 3, 2007

COPYING indirect formula. When I copy, the lookup reference does not change. My formula is =INDIRECT("'"&\$A247&"'!j106"). When I copy horizontally across cells, I want J106 to increase, ie j107, j108 etc. At the moment it remains at J106 and i have to manually increase the numbers by 1.

How do I change my formula so that the numbers increase automatically?

## SUMPRODUCT / INDIRECT Functions Not Working With ROW Reference When Combined

Apr 4, 2014

Basically I have an equation:

=SUMPRODUCT(G9:G11,H9:H11)/SUM(G9:G11)

It's just a simple percentage calculator for my purposes and works fine as is. However, I want to make it dynamic whereby from a user input the length of the array will increase or decrease, e.g. G9-G11 will become G9-G12 if there are four rows occupied with data. For all my other SUMming equations I have solved this and even came up with what I think is a perfectly valid solution for this one. The one problem is that it doesn't work when combined into a single equation.

My solution for the upper part of the fraction is this:

"A1"=SUMPRODUCT(INDIRECT("G9:G"&MIN(ROW(G9)+A8-1)),INDIRECT("H9:H"&MIN(ROW(H9)+A8-1)))

Where the user inputs the number of rows used in A8.

The solution for the lower part of the fraction is this:
"A2"=SUM(INDIRECT("G9:G"&ROW(G9)+A8-1))

[code]....

## How To Update Cell Reference When Dragging - INDIRECT Formula

Jul 10, 2014

I am using the formula below to sum across several worksheets, and the formula I am using works fine, but when I copy the formula across to other cells, I can't figure out how to have it update my cell range:

=SUMPRODUCT(SUMIF(INDIRECT("'"&\$A\$1:\$A\$4&"'!A:A"),\$B4,INDIRECT("'"&\$A\$1:\$A\$4&"'!G:G")))

The range A:A is ok to be static, but I need the G:G to be dynamic so when I drag it to the right it will change from G:G to H:H. I:I, etc.

## Reference Sheet Names With Indirect Function To Make Formula?

May 21, 2014

Attached I have a document where I am wanting all of the individual sheet names on the Total page. Rather than having to change each formula to match the sheet name I believe there is a way to reference the sheet name column (AO) in the formula so you can drag it down to fill in the columns. I am basic with Excel and do not know how to add this indirect function into my current formulas.

## Reference Last Row In Sumif VBA

Mar 20, 2009

I recorded this sumif in VBA, but know I am trying to figure out how to tie in the last row reference in place of the 27.

=SUMIF(\$AR\$2:\$AR\$27,\$AR29,AS\$2:AS\$27)
FormulaR1C1 = "=SUMIF(R2C44:R27C44,RC44,R2C:R27C)"

## SumIf Reference To Date

Jan 18, 2010

How can I reflect the correct trainee count for Day1-Batch1?

Currently columns F,G,H computes for expected, actual and total variances of trainee respectively reference to the training date J3.

Since this is a 2-day per batch even, I could not capture the 1st day trainee total of every batch because I divide the sum by 2 (2 day / training batch). The sum is only corrected on the 2nd day.
Attached herein is the sample file.

## Sumif With Named Reference

Sep 15, 2006

See attached for an example. I'm trying to use the SumIF funtion with a named reference as the criteria. Here is my formula. =SUMIF(B10:F10,"<MinReq",B10:F10) It keeps returning 0 even though there is valid data.

## SUMIF Formula With Reference To A Cell

Jun 29, 2006

I attached a file I made conditional formatting on cells C4..G6 which makes any number less than value in cell C15 invisible. In line " Total" I used SUMIF formulas which ignore any value less than 30. However the formulas should not contain static numbers but rather a reference to cell C15. But I simply cannot make it work.