Indirect formula based off cell value on current sheet

ItalianPlatinum

Well-known Member
Joined
Mar 23, 2017
Messages
880
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I wasn't getting much action on a prior thread I posted Find last row of sheet based off cell value to reference the sheet name. So posting again with little more troubleshooting I have done as well as simplifying the ask. Either formula or VBA - how can I set a formulas range to be dynamic of the Last row of a given sheet. I.e below. I tried creating a helper column in column D but can't get a way to in cooperate. I am applying these formulas via VBA if it matters. The below is just a drafted version of a much larger data set over 1million rows and potential of 25 sheets hence need it to be dynamic.

Book2
ABCD
1ListEligible to ConsolidateConsolidatedTotal Consolidated
2G234567890Similar Formula7
3G234567800Similar Formula7
4G234567810Similar Formula7
5G234567820Similar Formula7
6H234567820Similar Formula6
7H234567810Similar Formula6
8H234567830Similar Formula6
9I234567810Similar Formula5
10I234567820Similar Formula5
11I234567830Similar Formula5
12I234567840Similar Formula5
13I234567850Similar Formula5
14I234567860Similar Formula5
Summary
Cell Formulas
RangeFormula
B2:B5B2=IFERROR(COUNTIFS(INDIRECT(LEFT(A2,1)&"!$D$2:$D$7"),A2,INDIRECT(LEFT(A2,1)&"!$Q$2#"),">1"),0)
B6:B14B6=IFERROR(COUNTIFS(INDIRECT(LEFT(A6,1)&"!$D$2:$D$9154"),A6,INDIRECT(LEFT(A6,1)&"!$Q$2#"),">1"),0)
D2:D14D2=COUNTA(INDIRECT(LEFT(A2,1)&"!$D$2:$D$9154"))
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Although whole column referencing is frowned upon, the documentation indicates that CountIf (and its siblings) are Used Range aware and I have to assume that applies to the newer CountIfs versions as well.
So asuming your formulas works on the limited range, try this.
Excel Formula:
=IFERROR(COUNTIFS(INDIRECT(LEFT(A2,1)&"!$D:$D"),A2,INDIRECT(LEFT(A2,1)&"!$Q:$Q"),">1"),0)
 
Upvote 0
Solution
Do you think I will experience performance issues using full columns? That was my fear that led me down the path of using a last row
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,111
Members
453,021
Latest member
Justyna P

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