+ Reply to Thread
Results 1 to 9 of 9

Count the Number of Fridays in a Month

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-29-2008
    Location
    Grand Rapids, MI
    MS-Off Ver
    Office 2010
    Posts
    127

    Count the Number of Fridays in a Month

    I'm building a budget model, and I need to figure out a way (for a more accurate budget) how to count the number of fridays (or thursdays, etc.)

    Ok, so the assumptions:

    in A1 is the day i need to count: Friday
    in B1 is the Month/Year : Jan - 09
    in C1 is the next Month/Year: Feb - 09
    etc.

    There are 5 Friday in Jan and 4 in Feb.

    What would a good formula for this be?

    Thanks!
    Last edited by robert_shindorf; 01-26-2009 at 08:50 PM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,700

    Re: Count the Number of Fridays in a Month

    See attached,

    A2:A3 contain numbers 1 to 7 representing Sunday to Saturday, these are formatted as dddd to show the relevant day of the week.

    Formula in B2 copied across and down

    =4+(DAY(B$1+34)<WEEKDAY(B$1-$A2))
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    06-29-2008
    Location
    Grand Rapids, MI
    MS-Off Ver
    Office 2010
    Posts
    127

    Re: Count the Number of Fridays in a Month

    perfect!

    as a secondary question... what's the best way to have a formula to add 1 month across the top?

    you can do =b1+30, but you'll have issues... is there a month()+1 or something?

  4. #4
    Forum Contributor
    Join Date
    06-29-2008
    Location
    Grand Rapids, MI
    MS-Off Ver
    Office 2010
    Posts
    127

    Re: Count the Number of Fridays in a Month

    also, will you explain that formula to me? i don't understand why you have a +34, etc.

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,700

    Re: Count the Number of Fridays in a Month

    If B1 has the 1st of the month and you want each successive 1st of the month then you don't even need a formula, you can just drag B1 across and it should increment them automatically......or with a formula

    =EDATE(B1,1)

    which uses Analysis ToolPak add-in function or, avoiding that

    =DATE(YEAR(B1),MONTH(B1)+1,DAY(B1))

    or (only works if dates are the 1st of the month)

    =B1+32-DAY(B1+31)

  6. #6
    Forum Contributor
    Join Date
    06-29-2008
    Location
    Grand Rapids, MI
    MS-Off Ver
    Office 2010
    Posts
    127

    Re: Count the Number of Fridays in a Month

    awesome... sometime there are fiscal years instead of a calender year, so a formula is required for certain functions!

  7. #7
    Registered User
    Join Date
    04-18-2013
    Location
    Brisbane
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Count the Number of Fridays in a Month

    Seriously cool formula.
    Thanks daddylonglegs.

    Cheers

  8. #8
    Registered User
    Join Date
    02-08-2014
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Count the Number of Fridays in a Month

    the formula works magic excuse my ignorance though but what is the function of the " < " in the above formula "=4+(DAY(B$1+34)<WEEKDAY(B$1-$A2))"

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Count the Number of Fridays in a Month

    It's the "less than" symbol.

    It's testing that DAY(B$1+34) is less than WEEKDAY(B$1-$A2).

    If that condition is TRUE then it adds 1 to 4.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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