Find Dynamic date

rickyckc

Active Member
Joined
Apr 1, 2004
Messages
327
Hi all,

Is it possible by functions or VBA, to find dates like, example,

2nd Monday of October,

Last Friday (of the month) for September,

3rd Sunday of April,

etc etc ?

Thanks.

Best Regards,
Ricky
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
yes it is. Unfortunately, you have to give us a little bit more information about what you want to accomplish before we can give you good examples. Take a look at the VLOOKUP formula, or the VBA function Range.Find
 
Upvote 0
Hi Harvey,

I've made a simple world time......with rows of cities, and a column showing their local time. What i need now is based on the DST settings, the local time will adjust accordingly when the date comes

Best Regards,
Ricky
 
Upvote 0
you want to change the local time of the user computer to the time selected in excel?
or just put the time/dat from the selected cell in another cell?
 
Upvote 0
Hi Harvey,

I just want to change the cell,

example i have,

A B C D E
Baltimore -5 4pm 1st_Sun_of_Apr Last_Sun_of_Oct

and when 1st Sunday of April arrives .....it will add 1 hr and shows,

A B C D E
Baltimore -5 5pm 1st_Sun_of_Apr Last_Sun_of_Oct

and when Last Sunday of October arrives .....it will minus back 1 hr

Best Regards,
Ricky
 
Upvote 0
I'm sorry to ask you again, but I am still not sure if I understand what you need. (had a rough time last night ;))

you have three cells, lets say, lets call them A, B and C.
in A is a date.
in B is a time.
in C is a condition for summertime (1st_Sun_of_Apr Last_Sun_of_Oct)

now you want to have B contain +1 hour if it matches the condition in C (first sunday of april till last sunday of october)

Theoretically, this is best done with a formula in another cell, for instance, D.

Now I have this questions left:

are the conditions all formulated in the same way?
(ie. do they start all on sunday, are they all like
1st_sun_of_apr last_sun_of_oct
1st_sun_of_mar last_fri_of_dec
3th_tue_of_jun 2nd_mon_of_may)

how many date are in the sheet?
(can you maybe post an example, using the html maker?)
 
Upvote 0
Hi Harvey,

Sorry, I am in office now and the file is back in my home pc, so I cannot make a html.

The DST settings are different, eample...

Adelaide = Last Sunday of October - Last Sunday of March
Amman = Last Thursday of March - Last Thursday of September
Alexandria = 1st Saturday of May - Last Wednesday of September

etc, etc

It does not matter if the formula is in another cell/column.

I have total 602 cities and of course not all have DST

Best Regards,
 
Upvote 0
Code:
=RIGHT(LEFT(B1,FIND("-",B1)-2),LEN(LEFT(B1,FIND("-",B1)-2))-MIN(FIND("thisisamonth",SUBSTITUTE(LEFT(B1,FIND("-",B1)-2),{"januari"\"februari"\"march"\"april"\"may"\"june"\"july"\"august"\"september"\"october"\"november"\"december"},"thisisamonth")&"thisisamonth"))+1)
this function will return the month of the left end of the condition.
I am wondering if it's better to do this in VBA :LOL:
Looking forward to seeing your sheet ;)
 
Upvote 0
Hi Harvey,

I did not use your last code. Thanks anyway.

What I did was used codes writen by other people here and there and managed to get what I want.

Want me send you the excel file for your viewing of what I was trying to archiev ? If you want, just let me know your email addy.

Thanks again for your help.

Best Regards,
Ricky
 
Upvote 0

Forum statistics

Threads
1,207,090
Messages
6,076,520
Members
446,211
Latest member
b306750

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