INDIRECT in SUMIF formula - Relative reference problem (Excel 2007)

Pennimus

New Member
Joined
Jun 15, 2011
Messages
2
Hi all,

The following formula works to =sumif certain values from another worksheet when A3 is the name of the worksheet.

Code:
=SUMIF(INDIRECT("'"&$A3&"'!$A:$A"),"Churned",INDIRECT("'"&$A3&"'!Q:Q"))

When I drag this formula up or down my sheet, the row number in the reference to A3 changes as expected.

However, when I drag it right or left, the column reference Q:Q doesn't change, despite being a relative reference :confused:

Does anyone know how (or if) it's possible to make the reference to column Q change as normal in this formula?

Thanks very much for your help.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Q:Q isn't a reference, it's part of a string, so no wonder it doesn't change when you copy.

This may do what you want:
=SUMIF(INDIRECT("'"&$A3&"'!$A:$A"),"Churned",OFFSET(INDIRECT("'"&$A3&"'!A:A"),0,COLUMN()))
although you may have to add or subtract from COLUMN() depending on the location of the formula relative to column Q.
 
Upvote 0
You could also reference column Q in R1C1 relative to the cell holding the formula, removing the need for extra functions.

For example, if your formula is going in column G

=SUMIF(INDIRECT("'"&$A3&"'!$A:$A"),"Churned",INDIRECT("'"&$A3&"'!C[10]",0))

Column Q is 10 to the right of column G.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

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
Back
Top