Dynamic formula using named cells by partial name

wbstadeli

Board Regular
Joined
Mar 11, 2016
Messages
153
Office Version
  1. 365
Platform
  1. Windows
Hi All,

Is there a formula that I can use the would accommodate the following? Example: I need it to sum all named ranges called "AAA_(unique number)" and then dividing that by all named ranges called "BBB_(unique number)". So the (unique number) at the end of the name is variable, and these named ranges can/will be created after this formula is in place so I cant hard code the complete name in the formula, how would a write the formula to sum all the ranges that "match" a certain amount of the name (for this example, AAA and BBB)?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
I think what you need is function INDIRECT. That will allows you to type in some portions of the named ranged reference into a cell and have the formula report the calculation you seek. For example,

MrExcel posts18.xlsx
ABCDEFGHIJKLM
5Named range:AAA_111AAA_112AAA_113
6631AAA_111112113
71052
8565one wayAAA_111AAA_112AAA_113
9206783885
10469
11953another way783885
121041
13265
14830
152385
1651
1769
1848
1958
2005
21780
222
232
2410
253
2685
Sheet51
Cell Formulas
RangeFormula
K8:M8K8=$J$6&K6
K9:M9K9=SUM(INDIRECT(K8))
K11:M11K11=SUM(INDIRECT("AAA_"&K6))
D15D15=SUM(AAA_112)
B21B21=SUM(AAA_111)
G26G26=SUM(AAA_113)
Named Ranges
NameRefers ToCells
AAA_111=Sheet51!$B$6:$B$20B21
AAA_112=Sheet51!$D$6:$D$14D15
AAA_113=Sheet51!$G$6:$G$25G26
 
Upvote 0

Forum statistics

Threads
1,214,661
Messages
6,120,797
Members
448,994
Latest member
rohitsomani

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