Excel/count of Mondays, Tuesdays, etc. in the month...

Solved
benji71 Posted messages 789 Status Member -  
 Nico -
Hello everyone,

I have a little question... I would like to know the number of Mondays, Tuesdays, Wednesdays, Thursdays, and Fridays for a specific month. Do you have any suggestions for me... I started looking into the =WEEKDAY function but I have my doubts...

Practical example, in J2 I have a date 01/07/2010
I would like to know if it’s possible for Excel to put the number of Mondays in F15, the number of Tuesdays in G15, the number of Wednesdays in H15, the number of Thursdays in I15, and the number of Fridays in K15 for the month of July.

Thank you for sharing your thoughts and knowledge with me.

Best regards

Berni and his little troubles...

Configuration: Windows 7 / Internet Explorer 7.0

7 answers

  1. Darigh
     
    Even simpler to find the number of Mondays in a month:

    If A1 is the FIRST day of the desired month, then the number of Mondays in that month

    =NETWORKDAYS.INTL(A1, EOMONTH(A1, 0), "0111111")

    If you want to know the number of Thursdays, then use the expression "1110111", the number for Saturdays..."1111101".
    You got the trick....

    Works on Excel 2013 or later (I haven't tried it earlier)
    23
    1. gato_conbotas Posted messages 1 Status Member
       
      THANK YOU VERY MUCH
      0
    2. EnAvantGo
       
      Beautiful. Thank you. :)
      0
    3. Nico
       
      But yessss in 2020 ^^
      0
  2. Le Pingou Posted messages 12280 Registration date   Status Contributor Last intervention   1 479
     
    Hello,
    There is a small omission of a parenthesis for: (EOMONTH(A1,-1)+1)
    Correct formula:
    =INT((EOMONTH($A$1,0)-WEEKDAY(EOMONTH($A$1,0)-(1-1),2)-(EOMONTH($A$1,-1)+1)+8)/7) 

    --
    Regards.
    The Penguin
    2
  3. benji71 Posted messages 789 Status Member 23
     
    Good evening michel_m,

    allow me to thank you for your help and the solutions provided.

    I am only responding now because I had a bit of trouble applying the formulas...(not everyone is clever.. :-))

    While I was able to implement the first proposed solution, I cannot correctly apply the second one... and that’s the one I’m interested in...(well of course..:-)

    I tried to do as instructed, namely:

    in a1 the date
    in b1 the formula: =
    ENT((FIN.MOIS($A$1;0)-JOURSEM(FIN.MOIS($A$1;0)-(1-1);2)-FIN.MOIS($A$1;-1)+1+8)/7)

    in b2: =ENT((FIN.MOIS($A$1;0)-JOURSEM(FIN.MOIS($A$1;0)-(2-1);2)-FIN.MOIS($A$1;-1)+1+8)/7)

    in b3: =ENT((FIN.MOIS($A$1;0)-JOURSEM(FIN.MOIS($A$1;0)-(4-1);2)-FIN.MOIS($A$1;-1)+1+8)/7)

    in b4: =ENT((FIN.MOIS($A$1;0)-JOURSEM(FIN.MOIS($A$1;0)-(4-1);2)-FIN.MOIS($A$1;-1)+1+8)/7)

    but the total is not correct... for example in 02/2011, it shows 5 Mondays.. which I think is not correct....

    can you help me with the mistake I made..?

    for your information here is the file:
    http://www.cijoint.fr/cjlink.php?file=cj201011/cijiPil9I6.xls

    thank you for your help...

    best regards

    berni//
    1
    1. Darigh
       
      Even simpler to find out the number of Mondays in a month:

      If A1 is the FIRST day of the desired month, then the number of Mondays in that month

      =NETWORKDAYS.INTL(A1;EOMONTH(A1;0);"0111111")

      If you want to know the number of Thursdays, then use the expression "1110111", the number of Saturdays ..."1111101".
      You got the trick....
      0
  4. benji71 Posted messages 789 Status Member 23
     
    wouldn't it be possible?
    0
  5. michel_m Posted messages 18903 Registration date   Status Contributor Last intervention   3 320
     
    Hello

    the date in A1

    1st day of the month in A1 in A2
    =EOMONTH(A1;-1)+1

    last day in B2
    =EOMONTH(A1;0)


    number of Mondays in month A1
    =INT((B2-WEEKDAY(B2-(1-1);2)-A2+8)/7)

    or without A2 and B2
    =INT((EOMONTH(A1;0)-WEEKDAY(EOMONTH(A1;0)-(1-1);2)-EOMONTH(A1;-1)+1+8)/7) 

    for the number of Sundays
    =INT((B2-WEEKDAY(B2-(7-1);2)-A2+8)/7)

    Tuesdays
    =INT((B2-WEEKDAY(B2-(2-1);2)-A2+8)/7)


    for Wednesday, the number in bold:3; Thursday:4 etc.

    the EOMONTH function is accessible via the analysis utility enabled (tools-macros add-ins
    Michel
    0
  6. benji71 Posted messages 789 Status Member 23
     
    Good evening, penguin,

    allow me to thank you for this additional information that is so useful.

    thank you for your availability.

    best regards,

    berni//
    0
  7. michel_m Posted messages 18903 Registration date   Status Contributor Last intervention   3 320
     
    Hello,

    indeed, I was too quick to reply to you and I forgot the parentheses (it's an old trick from my attic that actually isn't mine)
    try
    =EOMONTH(A$1,0)-WEEKDAY(EOMONTH(A$1,0)-(5-1),2)-( (EOMONTH(A$1,-1)+1 )+8)/7)

    conclusion by this old Chinese proverb:
    "If you're in a hurry, start by sitting down"

    --
    Michel
    0
    1. Le Pingou Posted messages 12280 Registration date   Status Contributor Last intervention   1 479
       
      Hello michel_m,
      Just for fun and to make up for my intrusion:
      =SUMPRODUCT((WEEKDAY(ROW(INDIRECT(EOMONTH(A1,-1)+1":"&EOMONTH(A1,0)));2)=3)*1)
      Note: with (=3) for Wednesday!
      Friendly regards.
      The Penguin
      0