+ Reply to Thread
Results 1 to 48 of 48

create specific event at specific time every week

  1. #1
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    create specific event at specific time every week

    i would like to know how can do the following
    i have some even that occur at specific time every week
    i have workday for one year
    and i want to select specific month which have four week

    the even is the following
    1- occur only one time / month (in the first working day of the month )
    2- occur one time every / week (in the first working day of first week)
    3- occur one time every / week ( in the second working day of first week)
    4- occur one time every / week ( in the third working day of first week)
    5- occur one time every / week ( in the fourth working day of first week)
    6- occur one time every /week ( in the five working day of first week )
    I need function in cell F that related to data in column E in sheet sample according to working day in refer sheet in column G
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: create specific event at specific time every week

    Are you saying the sampling points in column K should occur on the weekday specified in column L i.e Event C1 only occurs on the first working day of the month specified in B2?

    And what are the working days?

    .... and why not sort the Weekly Plan data by the Sampling date?
    Last edited by JohnTopley; 08-01-2016 at 04:22 AM.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: create specific event at specific time every week

    I ordered the data by date/event with C1 being the initial event.

    in F3

    =DATE(C2,MONTH(B2&0),1)+CHOOSE(WEEKDAY(DATE(C2,MONTH(B2&0),1),1),7,6,5,4,3,2,1)

    calculates first SUNDAY (as this appears to be your first work day)

    in F4

    =$F$3+(MATCH(First,Week,0)-1)*7

    This calculates the first day of a given week

    "Week" is a named range

    For 2nd day of week

    =$F$3+(MATCH(First,Week,0)-1)*7+1
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    Dear JohnTopley

    i note that when i select August in B2 is started from 7-8 but actually first working day in this month is 1-8
    also i this it will be good if it depend upon column G In refer sheet because its contain working days after exclude weekend ( Friday and Saturday) and holidays .
    can please check and see what we can do
    thanks for your attention and concern
    happy day

  5. #5
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    also i note that something in function in refer sheet in G4 , its exclude some working days
    please see my attached photo
    Attached Images Attached Images

  6. #6
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    if this comment is correct

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: create specific event at specific time every week

    What happens in September when first workday is Friday: does this mean only one day for this week?

    and September 15th is only day in a week.

    You need to CLEARLY define what is required in these circumstances.
    Last edited by JohnTopley; 08-01-2016 at 02:25 PM.

  8. #8
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    in September first day is Thursday equal 1 but the equation give me direct 4 Sunday

  9. #9
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    this photo for correct data for august
    Attached Images Attached Images

  10. #10
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    it must be like this

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: create specific event at specific time every week

    There is no consistency in calculating the first working day of the month: for "August" you now say it is the end of July.

    What about September where have 1st September then the 4th : what is the output here.

  12. #12
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    its rules that sample taken every week in the same manner of attached phtoo
    Attached Images Attached Images

  13. #13
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    1 September will taken to complete for august month
    but in September will be start taken from 4

  14. #14
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    the problem appear in august because it must start from 31 not from 7

  15. #15
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    hope you understand me now

  16. #16
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: create specific event at specific time every week

    I understand that generally we start on the first Sunday of the month: it is the anomalies that cause the problem

    31 st July for August
    4th September is OK as it is the first Sunday.
    3rd October is a MONDAY (1st/2nd are holidays) so do we ignore the Monday?
    30th October is another potential problem as it the NEAREST Sunday to 1st November.

    This where the problem lies: the inconsistencies.

  17. #17
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054
    What is your advice to overcome this problem


    Quote Originally Posted by JohnTopley View Post
    I understand that generally we start on the first Sunday of the month: it is the anomalies that cause the problem

    31 st July for August
    4th September is OK as it is the first Sunday.
    3rd October is a MONDAY (1st/2nd are holidays) so do we ignore the Monday?
    30th October is another potential problem as it the NEAREST Sunday to 1st November.

    This where the problem lies: the inconsistencies.

  18. #18
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: create specific event at specific time every week

    See the attched.

    I added a column H in "REFER" which has a month nuumber against the first date for a month. The "only" issue is October where there is no initial Sunday.

    in F3 of "Sample"

    =INDEX(' refer'!G4:G250,MATCH(MONTH($D$2),' refer'!$H$4:$H$250,0))

    this finds the starting date for Sunday of week 1.

    I'll sign off for today and re-start tomorrow.
    Attached Files Attached Files

  19. #19
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    Dear Johntoply
    i would like to appreciate your effort and your concern .
    please kindly see my attached photo because its give another error
    Attached Images Attached Images

  20. #20
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    i have some idea i think it can solve this problem and non-consistencies data
    if we can create in refer sheet working day according to weekend and holidays (yearly , or annually) in specific column
    then according to this column create another column which distribute this according to week start from Sunday till Thursday
    then use this data to create the plan in sampl sheet
    i think it can solve it


    and please see another error i find
    Attached Images Attached Images
    Last edited by mazan2010; 08-02-2016 at 02:13 AM.

  21. #21
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    hope we can get good solution

  22. #22
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: create specific event at specific time every week

    The entry in column H should correspond to the month so you have 7 when the month is January so if you have 8 for February then when you select August (the 8th month) you get FEBRUARY. So January should have 1 and February have 2 etc.

    8 was placed on 31st July because 31st July was the first Sunday for the AUGUST period:

    Using the above method I proposed i.e. identify the FIRST week for a month, then the solution I gave earlier should work.

  23. #23
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    please i cant understand can explain more or give me example

  24. #24
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: create specific event at specific time every week

    The example was given in the last file I posted.

    You set the first Sunday of each month to the numeric value of that month in column H.

    So 3rd July is set to 7, 31st July set to 8, 4th September set to 9 etc.

    this formula ..

    =INDEX(' refer'!G4:G250,MATCH(MONTH($D$2),' refer'!$H$4:$H$250,0))

    matches month in date in D2 to find the start date in column G of "Refer" using the value in column H.

  25. #25
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    dear johnTopley
    please can see attached photo that G4 in refer sheet is started from 2-1-2017 although 1-1-2017 is working day (sunday)
    Attached Images Attached Images

  26. #26
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: create specific event at specific time every week

    Change G4

    =IF($F$4<$F$5,WORKDAY.INTL($F$4,0,7,OFFSET($E$4,,MATCH(YEAR($F$4),$E$3:$CP$3,0),30,1)),"")
    Last edited by JohnTopley; 08-03-2016 at 05:40 AM.

  27. #27
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    please can check my attached file for number add to column H if it correct and that you mean
    Attached Files Attached Files

  28. #28
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: create specific event at specific time every week

    Yes .. that appears to be working as expected.
    Last edited by JohnTopley; 08-03-2016 at 11:31 AM.

  29. #29
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    this number can be make automatic because every time i must be change it manual
    if there is any formula that count first sunday every month and give it number in Column H

  30. #30
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: create specific event at specific time every week

    There is BUt that it does not work because of holidays and months which don't start on the first Sunday of the month i.e July 31st for start of August.

    We have been down this route and it takes all of a minute to it manually.

    See here ....

    http://www.accountingweb.com/technol...month-in-excel
    Last edited by JohnTopley; 08-03-2016 at 11:56 AM.

  31. #31
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: create specific event at specific time every week

    See the attached which marks the first Sunday in each month.

    in E6

    =YEAR(F4) Year we are considering

    in F7

    =DATE($E$6, ROW(1:1),1)+6-WEEKDAY(DATE($E$6, ROW(1:1), 1),3)

    Copy down

    This a list of the first Sunday for each month in the chosen year

    In H4

    =IFERROR(IF(MATCH($G4,$F$7:$F$18,0),MONTH($G4),""),"")

    Copy down

    This flags the first Sunday of each month with month number (1, 2, 3 etc)
    Attached Files Attached Files

  32. #32
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    please see my attached photo that give me friday as working day in first day of the year
    Attached Images Attached Images

  33. #33
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: create specific event at specific time every week

    This is issue with WORKDAY.INTL

    Try

    in G4

    =IF($F$4<$F$5,WORKDAY.INTL(EOMONTH($F$4,-1),1,7,OFFSET($E$4,,MATCH(YEAR($F$4),$E$3:$CP$3,0),30,1)),"")

    Give all the time I have spent on this, I think it is not unreasonable that you try and resolve these issues yourself.

    Use "Google" to find in these issues are known.

  34. #34
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    there is some modification if can be do in formula in sheet Sampl
    as attached photo
    Attached Images Attached Images

  35. #35
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: create specific event at specific time every week

    Sorry but there are always going to exceptions like this with no common factor (logic) to determine when it should be changed.

  36. #36
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    i would like to know can't add some function that give this probalility ( function that if the Sunday not started in first week and coming in second week like in our example coming in 7-1 , in this case look for previous sunday in previous month (31-12-2017)

  37. #37
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: create specific event at specific time every week

    What happens 2019 when 6th January is first Sunday, or 2020 when 5th January is first Sunday??????

  38. #38
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    in 2019 it will be 30-12-2018
    in 2020 it will be 29-12-2019
    this what i mean
    it just search for previous sunday (in previous month ) not search for number but search for Sunday and start from this

  39. #39
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    the Rule is take sample every week stared from Sunday till Thursday

  40. #40
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: create specific event at specific time every week

    So if the January start date is ANYTHING other than the 1st of January we go back 7 days into December?

  41. #41
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: create specific event at specific time every week

    This is the FINAL version:

    D3 contains the TRUE first Sunday in month.

    in F3

    =IF(AND(MONTH(D3),DAY(D3)>1),D3-7,D3)

    Checks if NOT first of January then got back to previous Sunday.

    If you want anything different you should now be able to work out the logic yourself.
    Attached Files Attached Files

  42. #42
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    please see my photo
    Attached Images Attached Images

  43. #43
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    and started from 28-1-2018 not 28-12-2017

  44. #44
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: create specific event at specific time every week

    My mistake .... but you work out why as I copied the cell from F3 to D3: look at the formula in the cell.

  45. #45
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    not understand what you mean exactly

  46. #46
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    and why you start from from E4 although data started from E6
    HTML Code: 

  47. #47
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,196

    Re: create specific event at specific time every week

    You haven't worked out how this formula works!!

    should be

    =INDEX(' refer'!$G$4:$G$250,MATCH(MONTH($D$2),' refer'!$H$4:$H$250,0))

  48. #48
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: create specific event at specific time every week

    really thank you Dear JohnTopley for all your effort and all attention
    i will test the file and if have any think i will send you
    really thanksssssssssss

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] macro to copy specific columns and rows for a specific month and week
    By Shellybelly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-23-2015, 11:23 AM
  2. Starting Week number by specific time
    By naiconn in forum Excel General
    Replies: 5
    Last Post: 12-03-2014, 08:37 AM
  3. program a formula to count number of times event occur before a specific time.
    By yinxzon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-17-2014, 04:15 AM
  4. Alter Worksheet Change Event at specific time after the data is manually changed..
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-22-2014, 05:12 PM
  5. [SOLVED] Code to run a Macro on a specific day of the week at a specific time.
    By mjfox52610 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-16-2013, 11:40 PM
  6. Receiving a date week by week depends on specific number?
    By ExcelBG in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-27-2013, 10:20 AM
  7. Trying to Create Msg Box for Specific Event
    By takisis666 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-07-2010, 01:02 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1