Dynamic Named ranges in formula.

Phil Payne

Board Regular
Joined
May 17, 2013
Messages
131
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I have set up the means to determine and count the number of public holidays during a year on a month by month basis.
They work but I need the calendars to be dynamic to allow local holidays to be added.
I have tried to set up a dynamic ranges to work within the existing formula to no avail, an error always occurs.

Can someone tell the what adjustments are needed to this working formula to make it work with dynamic range please?
=NETWORKDAYS(P2,EOMONTH(P2,0),Holiday_Calendars!$E$4:$E$13)

I would like to replace “Holiday_Calendars!$E$4:$E$13” part with a dynamic named range.

Any help is appreciated.

Holiday_Calendars and Data Sheet images attached for info:
 

Attachments

  • image_2023-08-14_135928158.png
    image_2023-08-14_135928158.png
    111.4 KB · Views: 12
  • SnipImage1.JPG
    SnipImage1.JPG
    13.7 KB · Views: 12
Yes the calendars need to be adjusted for national and also local employer agreements by the user.
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
In that case you are going to have problems getting a dynamic range to work. Normally you would use something like
Excel Formula:
=A4:INDEX(A:A,COUNT(A:A)+3)
but this will not work if you have more dates below A14 (based on the image in your op)
 
Upvote 0
I know what you mean.
I have arranged the data for each year side by side (from left to right) so specifying a whole column range is not a problem as there can be no overlap of data.

I thought i had cracked it when I made the calendars ranges into tables. It immediately worked as far as adding and subtracting entries, unfortunately the Custom Views that were well established around he same data no longer work - the Custom View button is disabled..

Do you know why that should be?

Back to the drawing board.
 
Upvote 0
I've never used Custom Views, so cannot help with that.
 
Upvote 0
Not a problem Fluff, I think I've cracked it.

A long while ago i realised that if you establish an empty boundary around a range and set the Named Range to include the bottom empty boundary AND insist that any additions to the range are made above the bpttpm boundary by Inserting a Cells/Rows then it effectively becomes dynamic.

I have re-established this practise and it works. The red rows in attached image are included in their named ranges.

Thank you for all your help.
 

Attachments

  • Calendar Boundaries.PNG
    Calendar Boundaries.PNG
    126.9 KB · Views: 6
Upvote 0
Solution
Glad you sorted that & thanks for letting us know.
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,305
Members
452,633
Latest member
DougMo

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