+ Reply to Thread
Results 1 to 9 of 9

Calculation for biweekly pay periods in a given month

  1. #1
    Registered User
    Join Date
    10-06-2012
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    4

    Question Calculation for biweekly pay periods in a given month

    I'm having difficulty writing/finding a calculation that, given a start date and a month (should I include the current year or what?), calculates the number of biweekly pay periods in that month. For example, if an employee is paid first on October 12, 2012, and I'm looking at the month of November of 2012, I would like the calculation to return the number 2, since they would be paid on the 9th and the 23rd of November.

    Would someone be able to assist me?

  2. #2
    Forum Contributor
    Join Date
    10-02-2012
    Location
    Bumi Nusantara
    MS-Off Ver
    Excel 2010; Excel 2016
    Posts
    136

    Re: Calculation for biweekly pay periods in a given month

    let's say,
    1st paid date is cell B2 = 12 October 2012
    2nd paid date is cell B3
    3rd paid date is cel B4

    so, formula in B3=B2 +14
    copy it down
    you'll get 3th paid is 9th Nov 2012 and 4th paid is 23rd Nov 2012

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

    Re: Calculation for biweekly pay periods in a given month

    Let's say you have the first pay date in A1

    Now if you put any 1st of month date in A5 then this formula will give you the number of paydates in that month

    =3-(FLOOR(A5-A$1,14)+A$1+42 >EOMONTH(A5,0))
    Audere est facere

  4. #4
    Registered User
    Join Date
    10-06-2012
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Calculation for biweekly pay periods in a given month

    Thank you for replying, but that is not what I'd requested. Perhaps I wasn't very clear. I'll try to explain better what I'm looking to accomplish.

    Suppose:

    A1 is the date of an employee's first paycheck, let's say Friday, January 4, 2013
    A2 through L2 are the targets for the calculation

    A2 (January) should contain 2 because January, 2013 would have two paydays
    B2 (February) should contain 2 because February, 2013 would have two paydays
    C2 (March) should contain 3 because March, 2013 would have three paydays
    D2 (April) should contain 2 because April, 2013 would have two paydays
    E2 (May) should contain 2 because May, 2013 would have two paydays
    F2 (June) should contain 2 because June, 2013 would have two paydays
    G2 (July) should contain 2 because July, 2013 would have two paydays
    H2 (August) should contain 3 because August, 2013 would have three paydays
    I2 (September) should contain 2 because September, 2013 would have two paydays
    J2 (October) should contain 2 because October, 2013 would have two paydays
    K2 (November) should contain 3 because November, 2013 would have three paydays
    L2 (December) should contain 2 because December, 2013 would have two paydays

    Maybe there's already a function that does this, or maybe my brain is so tired right now that I can't see a simple solution, but any help would be appreciated.

  5. #5
    Registered User
    Join Date
    10-06-2012
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Calculation for biweekly pay periods in a given month

    Thank you daddylonglegs, that's more along the lines of what I am requesting.

    It's close, but it doesn't appear quite correct. Using the example date of 1/4/2013 I gave above, August yields 3 correctly but March and November do not.
    Last edited by cstricklin; 10-06-2012 at 10:30 AM. Reason: After testing formula

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

    Re: Calculation for biweekly pay periods in a given month

    Yes, you're right, small tweak to the formula which also makes it work in earlier excel versions:

    Assuming A2:L2 contain the first of the month dates you can use this formula in B2 copied down

    =3-(A2-MOD(A2-A$1-1,14)+41 >EOMONTH(A2,0))

    I agree that March and August should be 3 for your example but I think all other months (including November) should be 2

  7. #7
    Registered User
    Join Date
    10-06-2012
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Calculation for biweekly pay periods in a given month

    Yes, my mistake, you are correct, November would also have 2 paydates given this example. Now I just need to extrapolate this for my ultimate usage.

    Thanks very much for the help.
    Charles Stricklin

  8. #8
    Registered User
    Join Date
    02-10-2020
    Location
    Toronto
    MS-Off Ver
    Office 365
    Posts
    1

    Re: Calculation for biweekly pay periods in a given month

    Hey!!
    Just curious why did you add 41 in the formula?

  9. #9
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    514

    Re: Calculation for biweekly pay periods in a given month

    With esteemed daddylonglegs being away, I can give you some explanations.

    The logic behind his formula is as follows:

    1) Find the latest pay date before the target month: A2-(MOD(A2-A$1-1,14)+1)

    2) Add 42 days (3 pay periods) to that date: A2-(MOD(A2-A$1-1,14)+1)+42, reduced to A2-MOD(A2-A$1-1,14)+41

    3) Compare the resulting date to the end date of the target month. If the resulting date is within the target month, it has 3 pay dates; otherwise, it has 2 pay dates.

    Hope this helps.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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