+ Reply to Thread
Results 1 to 14 of 14

Formula to determine day of week checks will be cut

  1. #1
    Registered User
    Join Date
    02-05-2011
    Location
    Maryland
    MS-Off Ver
    Excel 2007
    Posts
    25

    Formula to determine day of week checks will be cut

    Hi everyone. I am not even sure if this is possible to do...

    Basically I invoice my company weekly and checks get cut on the 10th and 25th of every month. BUT if the check cut day falls on a Saturday it gets done on Friday and if it falls on a Sunday it gets cut on Monday. Is there a formula that will calculate the actual "pay date" for me?

    Here is an example
    Attached Files Attached Files
    Last edited by shanshine; 09-28-2011 at 12:52 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula to determine day of week checks will be cut

    Try:

    =B2+IF(WEEKDAY(B2,2)=6,-1,IF(WEEKDAY(B2,2)=7,1,0))

    copied down
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: Formula to determine day of week checks will be cut

    Try this formula in C2 and copy it down

    =IF(OR(WEEKDAY(B2)=2,WEEKDAY(B2)=3,WEEKDAY(B2)=4,WEEKDAY(B2)=5,WEEKDAY(B2)=6),B2,IF(WEEKDAY(B2)=1,B2+1,B2-1))

    Alan
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    02-05-2011
    Location
    Maryland
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Formula to determine day of week checks will be cut

    Quote Originally Posted by NBVC View Post
    Try:

    =B2+IF(WEEKDAY(B2,2)=6,-1,IF(WEEKDAY(B2,2)=7,1,0))

    copied down
    Thank you!!!

  5. #5
    Registered User
    Join Date
    02-05-2011
    Location
    Maryland
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Formula to determine day of week checks will be cut

    Quote Originally Posted by alansidman View Post
    Try this formula in C2 and copy it down

    =IF(OR(WEEKDAY(B2)=2,WEEKDAY(B2)=3,WEEKDAY(B2)=4,WEEKDAY(B2)=5,WEEKDAY(B2)=6),B2,IF(WEEKDAY(B2)=1,B2+1,B2-1))

    Alan
    They both worked!! Thanks!

  6. #6
    Registered User
    Join Date
    02-05-2011
    Location
    Maryland
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Formula to determine day of week checks will be cut

    Ok I misguided a little bit on this one...SORRY!!!

    That formula was exaclty what I asked for...I just asked for the wrong thing!

    I want it to calculate the day that it will be due (without me manually filling it in) either the 10th or the 25th (whichever is the closest to 30 days without going over 30 days) and compensate for the day of the week that it will be cut. Basically the date outcomes were correct I just dont want to have to fill in the second column anymore (because I have put the wrong date in there once or twice)

    Does that make sense?
    Attached Files Attached Files

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula to determine day of week checks will be cut

    See attached... with a few hidden columns with intermediate formulas...
    Attached Files Attached Files
    Last edited by NBVC; 09-21-2011 at 05:06 PM. Reason: Updated workbook

  8. #8
    Registered User
    Join Date
    02-05-2011
    Location
    Maryland
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Formula to determine day of week checks will be cut

    Quote Originally Posted by NBVC View Post
    See attached... with a few hidden columns with intermediate formulas...
    Its calulating the wrong due date...the due date is the 10th or the 25th whichever is closest to 30 days without going over so.....I made a third column to show the expected pay date. Maybe that will make more sense
    Attached Files Attached Files

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Formula to determine day of week checks will be cut

    Quote Originally Posted by shanshine View Post
    ...the due date is the 10th or the 25th whichever is closest to 30 days without going over so.....
    Some of your dates seem to break that rule. Date in A6 is 21/8/2011 - add 30 days to that and you get 20/9/2011 so wouldn't the due date be 10th September? Same applies to row 8.....

    Perhaps you could clarify - are the dates shown really the ones you need.......or is the rule wrong?
    Audere est facere

  10. #10
    Registered User
    Join Date
    02-05-2011
    Location
    Maryland
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Formula to determine day of week checks will be cut

    Quote Originally Posted by daddylonglegs View Post
    Some of your dates seem to break that rule. Date in A6 is 21/8/2011 - add 30 days to that and you get 20/9/2011 so wouldn't the due date be 10th September? Same applies to row 8.....

    Perhaps you could clarify - are the dates shown really the ones you need.......or is the rule wrong?
    Hahaha see I just proved my point when I try and figure it out myself I sometimes screw it up!

    Row 6 should be 9-9-11

    Row 8 should be 9-26-11

  11. #11
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Formula to determine day of week checks will be cut

    OK to do everything with a single formula......assuming you have week ending date in A2 use this formula in B2 for check cut date

    =LOOKUP(WEEKDAY(A2+31-DAY(A2+21)+(DAY(A2+21)>15)*15),{1,2,7;1,0,-1})+A2+31-DAY(A2+21)+(DAY(A2+21)>15)*15

  12. #12
    Registered User
    Join Date
    02-05-2011
    Location
    Maryland
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Formula to determine day of week checks will be cut

    Quote Originally Posted by daddylonglegs View Post
    OK to do everything with a single formula......assuming you have week ending date in A2 use this formula in B2 for check cut date

    =LOOKUP(WEEKDAY(A2+31-DAY(A2+21)+(DAY(A2+21)>15)*15),{1,2,7;1,0,-1})+A2+31-DAY(A2+21)+(DAY(A2+21)>15)*15
    It gave me a weird numbers....
    Attached Files Attached Files

  13. #13
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Formula to determine day of week checks will be cut

    Excel counts dates from 1900 - each day is 1 more so today is 40812....tomorrow is 40813 etc. just format the cells as dates to show as dates

    [select range > right-click > Format Cells > Number > Date > mm/dd/yyyy or as required]

  14. #14
    Registered User
    Join Date
    02-05-2011
    Location
    Maryland
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Formula to determine day of week checks will be cut

    Quote Originally Posted by daddylonglegs View Post
    Excel counts dates from 1900 - each day is 1 more so today is 40812....tomorrow is 40813 etc. just format the cells as dates to show as dates

    [select range > right-click > Format Cells > Number > Date > mm/dd/yyyy or as required]
    Awesome...I feel dumb! Thanks!!!

+ 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