SUMIFS and dynamic named ranges

kobe26

New Member
Joined
Feb 4, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
  1. i have a spreadsheet with data that changes in size so have created dynamic named ranges and the columns names also do change sometimes. So i have a formula that generate the name of columns based of a drop-down list. Would be easy if INDIRECT works with dynamic named ranges but it doesn't so i use a UDF(Getadd(D1) gets me the full address of dynamic named range (LayerData!$BK$2:$BK$100)
  2. Inc_ExclCat_Modelling_Inc_ExclYOA Exposure SI_CurrentExposure SI_Proposed
    1​
    1​
    2015​
    134,011134,011
    1​
    1​
    2015​
    612,376612,376
    1​
    1​
    2015​
    196,113196,113
    1​
    1​
    2016​
    196,113196,113
    1​
    1​
    2014​
    12,76312,763
    1​
    1​
    2013​
    255,260255,260
    1​
    1​
    2015​
    191,445191,445
    1​
    1​
    2016​
    102,104102,104
    1​
    1​
    2013​
    38,28938,289

VBA Code:
Function Getadd(rangeName As String) As Variant
    Dim rng As Range
   
    On Error Resume Next
    Set rng = Evaluate(rangeName)
    On Error GoTo 0
   
    If Not rng Is Nothing Then
        Getadd = "LayerData!" & rng.Address
       
    Else
        Getadd = "Named range not found or not dynamic."
    End If
End Function


to get the sheet name and address of dynamic name, but when i use it in my SUMIFS, it returns a #VALUE because of double quotation marks (well i guess).
image1.PNG

i tried to use SUBSTITUTE to get rid of the quotes but no dice. Been stuck on this for a day now so any help will be greatly appreciated
 

Attachments

  • Image2.PNG
    Image2.PNG
    4.5 KB · Views: 5

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Can you just use Tables? Columns in Tables resize automatically. What is an example of a changing column name in your lookup data? And how does it change?
What does your data look like (I am assuming your first table is some kind of calculated report).

Do you have a RAW data range/source or are you processing inside your RAW data?
 
Upvote 0
Can you just use Tables? Columns in Tables resize automatically. What is an example of a changing column name in your lookup data? And how does it change?
What does your data look like (I am assuming your first table is some kind of calculated report).

Do you have a RAW data range/source or are you processing inside your RAW data?
For some reason senior stakeholders prefer it not to be a table(they do use the raw data at times). Example of the columns changing is say Exposure_SI_Current changing to Exposure_SI_Inforce(there are about 200 columns and about 40 can change. My table are all raw data, the calculations are all done in python. I use vba to create all the dynamic named ranges. Hope this clarifies it a bit
 
Upvote 0
By::
Exposure_SI_Current changing to Exposure_SI_Inforce do you mean they rename the column or are they actually different values?
 
Upvote 0

Forum statistics

Threads
1,215,073
Messages
6,122,975
Members
449,095
Latest member
Mr Hughes

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