INDIRECT formula cell reference

rlexcel101

New Member
Joined
Apr 11, 2018
Messages
39
Hi I am having trouble referencing the cell in below formula vs. text.



=SUMPRODUCT(SUMIF(INDIRECT(""&data&"!"&"A6:A6"),$B12,INDIRECT(""&data&""!"&"D6:D6")))

data represents the line for sum values and name range of sheets (D6)..A6 is lookup on sheets and B12 is criteria.

The formula works but I have to go through ad manually change text vs dragging
 
Last edited:

Some videos you may like

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

AlanY

Well-known Member
Joined
Oct 30, 2014
Messages
3,981
Office Version
365, 2019, 2016
Platform
Windows
this is an example to combine indirect() and offset(), see if you can adopt it for your problem

<b></b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>A</th><th>B</th><th>C</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style="text-align: right;background-color: #E2EFDA;;">5</td><td style="text-align: right;;"></td><td style=";">Sheet2</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style="text-align: right;;">10</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style="text-align: right;;">15</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style="text-align: right;;">20</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">5</td><td style="text-align: right;;">25</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:4.8em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">A1</th><td style="text-align:left">=SUM(<font color="Blue">OFFSET(<font color="Red">INDIRECT(<font color="Green">$C$1&"!$A$1"</font>),ROW(<font color="Green">A1</font>)-ROW(<font color="Green">$A$1</font>),0,1,5</font>)</font>)</td></tr></tbody></table></td></tr></table><br />

<b></b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style="text-align: right;;">1</td><td style="text-align: right;;">1</td><td style="text-align: right;;">1</td><td style="text-align: right;;">1</td><td style="text-align: right;;">1</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style="text-align: right;;">2</td><td style="text-align: right;;">2</td><td style="text-align: right;;">2</td><td style="text-align: right;;">2</td><td style="text-align: right;;">2</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style="text-align: right;;">3</td><td style="text-align: right;;">3</td><td style="text-align: right;;">3</td><td style="text-align: right;;">3</td><td style="text-align: right;;">3</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style="text-align: right;;">4</td><td style="text-align: right;;">4</td><td style="text-align: right;;">4</td><td style="text-align: right;;">4</td><td style="text-align: right;;">4</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">5</td><td style="text-align: right;;">5</td><td style="text-align: right;;">5</td><td style="text-align: right;;">5</td><td style="text-align: right;;">5</td><td style="text-align: right;;">5</td></tr></tbody></table><p style="width:4.8em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sheet2</p><br /><br />
 

rlexcel101

New Member
Joined
Apr 11, 2018
Messages
39
I have the formula which works in pulling correct values I just have my reference as texts and trying to use a cell reference so I can drag formula
 

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,080
Office Version
365
Platform
Windows
What do you want the formula below the original one to be doing if you drag it down one cell? Using A6:A7, A7:A7, something else?
 

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,080
Office Version
365
Platform
Windows
Maybe this one which does A6:A6, A6:A7 etc as you drag:

=SUMPRODUCT(SUMIF(INDIRECT("'"&data&"'!A6:A"&ROWS($A$6:A6)+5),$B12,INDIRECT("'"&data&"'!D6:D"&ROWS($A$6:A6)+5)))
 

rlexcel101

New Member
Joined
Apr 11, 2018
Messages
39
Maybe this one which does A6:A6, A6:A7 etc as you drag:

=SUMPRODUCT(SUMIF(INDIRECT("'"&data&"'!A6:A"&ROWS($A$6:A6)+5),$B12,INDIRECT("'"&data&"'!D6:D"&ROWS($A$6:A6)+5)))
thanks

I inputted this formula and pulls but it’s still not dragging.

So D6 is basically one month but if I drag it stays as D6 when I need E6
 

rlexcel101

New Member
Joined
Apr 11, 2018
Messages
39
Still struggling trying to get “D6:D6” to reference as cells and drag across vs as text

Would really appreciate the help!
 

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,080
Office Version
365
Platform
Windows
You need to be answering the question in post 6. I presume you are dragging right. So what is the formula you want in the cell next to the original to be? Put it here in exactly the same way as you did for the original formula but the cell to the right. I would need to know what needs to change from cell to cell.
 

Watch MrExcel Video

Forum statistics

Threads
1,102,302
Messages
5,486,052
Members
407,529
Latest member
netojose

This Week's Hot Topics

Top