Dynamic name a column range based on today's date

CakzPrimz

Board Regular
Joined
Oct 6, 2017
Messages
55
Dears,

I have a data set which contain a date format, starting from N5 until CY5 (for 90 days)
In cell N5 is April 1, 2021 and cell W5 is April 10, 2021
Is it possible to name a range (column) based on today date.
So, if today is April 10, 2021 then Column W, will be named as "XDate", and if April 11, 2021 becoming today date then Column X will be named as "XDate".

Thanks in advanced
Prima - Indonesia
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

mart37

Well-known Member
Joined
Aug 4, 2017
Messages
1,091
Office Version
  1. 2016
Platform
  1. Windows
=OFFSET($N$1,0,TODAY()-$N$5,1048576)
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,729
Office Version
  1. 365
Platform
  1. Windows
Another option
Excel Formula:
=INDEX(Main!$N$5:$CY$10000,,MATCH(TODAY(),Main!$N$5:$CY$5,0))
Change Main to the name of your sheet.
 
Solution

CakzPrimz

Board Regular
Joined
Oct 6, 2017
Messages
55
Dear Fluff,

Your function is working. It is great. Wonderful !!

Thanks so much
Prima - Indonesia

Another option
Excel Formula:
=INDEX(Main!$N$5:$CY$10000,,MATCH(TODAY(),Main!$N$5:$CY$5,0))
Change Main to the name of your shee
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,729
Office Version
  1. 365
Platform
  1. Windows
Glad we could help & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,129,932
Messages
5,639,067
Members
417,067
Latest member
rohitbabshet

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
Top