+ Reply to Thread
Results 1 to 14 of 14

Conditional formatting based on bi-monthly payday criteria

  1. #1
    Registered User
    Join Date
    06-21-2016
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    5

    Conditional formatting based on bi-monthly payday criteria

    Hi,

    I'm doing my budget and I'm using conditional formatting to highlight payday.

    I've do some research into the forum but didn't find anything that helped me and after 3 pages, I stopped !!!

    Each month as is own table, first column is the date in short date format and the conditional formating must meet the payday criteria :
    1) Payday are twice a month, 15 and 30
    2) For month that are shorter then 30 days, last payday will be the last day of the month. This is only for February that can be on 28 or 29 depending on leap year(intercalary or bissextile year)
    3) Payday cannot be in weekend, will be the neared working day prior the 15 or 30. ex, if payday is Sunday, it will be payed on the Friday before, same thing for Saturday, it will be payed on the Friday before

    I was not able to add attachment, so I put it on my OneDrive. Here is the link : https://1drv.ms/x/s!AnNZyREwrGyMi8dW78iighjwbOrYsg

    Thanks !
    Last edited by slaforce; 06-23-2016 at 02:48 PM. Reason: Not able to add attachement, I've add a link

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Conditional formatting based on bi-monthly payday criteria

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  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,212

    Re: Conditional formatting based on bi-monthly payday criteria

    This will give pay days allowing for weekends

    in B1

    =IF(WEEKDAY(A1,2)>5,A1-WEEKDAY(A1,2)+5,A1)

    where Column A contains list of 15/30 dates and B contains adjusted dates i.e. allowing for W/E dates in A

    You could then compare your dates vs the table (column B) above.

  4. #4
    Registered User
    Join Date
    06-21-2016
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    5

    Re: Conditional formatting based on bi-monthly payday criteria

    Sorry, I wasn't able to add it with your instructions. Instead of "Manage file", I have "Manage Attachments", I'm able to upload it, but there is no "Done" button, just "Close this windows", then I'm not able to see it anywhere to add it to this post.

  5. #5
    Registered User
    Join Date
    06-21-2016
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    5

    Re: Conditional formatting based on bi-monthly payday criteria

    Thanks for your fast reply, but I don't want to have to manage another table with listing of dates ... I can be wrong 1 time and will affect the display. I really want it to be done based on my job payroll criteria.

  6. #6
    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,212

    Re: Conditional formatting based on bi-monthly payday criteria

    After "Upload" , "Close Window".

    Re your reply : for 24 pay days you could do it manually!!! The table was only a way to determine the pay days: you are going to have to do this calculation even if it is on piece of paper.

    Don't make things unnecessarily complex.
    Last edited by JohnTopley; 06-22-2016 at 05:18 PM.

  7. #7
    Registered User
    Join Date
    06-21-2016
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    5

    Re: Conditional formatting based on bi-monthly payday criteria

    I've done this to find the payday based on the date :
    =OR(DAY($H3)=15,DAY($H3)=30,DAY($H3)=IF(DAY(EOMONTH($H3,0))<30,IF(DAY($H3)=DAY(EOMONTH($H3,0)),DAY($H3),""),""))
    But this show me the date evan if it's the weekend and I cannot figured where I can add criteria to move the weekend payday to the last friday as the last payday criteria. It's mostly done ... just need other eyes.

  8. #8
    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,212

    Re: Conditional formatting based on bi-monthly payday criteria

    You cannot change data with CF: it only returns a TRUE or FALSE value.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Conditional formatting based on bi-monthly payday criteria

    Conditional Formatting only changes teh cosmetics of a cell - its font, text or cell color, it cannot change the underlying data.

    If you need to change the cell's contents, that needs to be done with a formula

  10. #10
    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,212

    Re: Conditional formatting based on bi-monthly payday criteria

    See the attached ....

    Formula to get pay days

    =IF(OR(DAY(H3)=15,DAY(H3)=30,AND(MONTH(H3)=2,DAY(H3)=29)),IF(WEEKDAY(H3,2) > 5,H3-WEEKDAY(H3,2)+5,H3),"")

    Results in named range Pay_Days

    CF: =MATCH($H3,Pay_Days,0)

    Results in H
    Attached Files Attached Files
    Last edited by JohnTopley; 06-23-2016 at 10:53 AM.

  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,212

    Re: Conditional formatting based on bi-monthly payday criteria

    Hopefully file now attached
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    06-21-2016
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    5

    Re: Conditional formatting based on bi-monthly payday criteria

    Thank you very much for your help!

  13. #13
    Registered User
    Join Date
    10-24-2012
    Location
    AZ, USA
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Conditional formatting based on bi-monthly payday criteria

    I know I am a little late to the party, but for anyone else looking for an alternate solution I have a slightly more complex solution that accounts for paying on 15th & EOM or paying ahead of that when the 15th/EOM falls on either a weekend or a company holiday.

    My company, for instance, gives us both Thanksgiving and Black Friday off, and EOM falls on the weekend this year; therefore, my formula had to account for being paid up to (4) days prior to EOM. I don't believe there is any instance where it would be 5 days prior, but that is why I added "HELP" as the "if all else fails" return value. I'm sure there is a more succinct way to accomplish this, but nested IF-statements work so I'm happy with it.

    STEPS:

    Set up a named range (highlight range, "formulas" tab, "Define Name") that contains all company-observed holidays; I names mine "HOLIDAYS2019" in my formula example below...it lives on another worksheet, but that isn't crucial.

    **All Headers are in row 1**
    My "Month" Column (A) has the following...

    A2: 1/15/2019
    A3: =DATE(2019,MONTH(A2),DAY(EOMONTH(A2,0)))
    A4: =DATE(2019,MONTH(A3)+1,15)
    A5: =DATE(2019,MONTH(A4),DAY(EOMONTH(A4,0)))

    Select A4 & A5 and then copy/paste down until you have DEC 15 & 31. I then changed the formatting for that column was only "MMM" while the actual cell values were still the 15th & EOM.

    I am exporting this to my google calendar, so I made a dynamic title column that reflected how I wanted to call out the payroll ("1st {MONTH} PayDay" or "2nd {MONTH} PayDay")
    ; feel free to exclude this, but that is why I am skipping column B here.

    My "PayDays" Column (C)has the following...
    C2: =IF(WORKDAY(A2-1,1,HOLIDAYS2019)=A2,A2,IF(WORKDAY(A2-2,1,HOLIDAYS2019)=A2-1,A2-1,IF(WORKDAY(A2-3,1,HOLIDAYS2019)=A2-2,A2-2,IF(WORKDAY(A2-4,1,HOLIDAYS2019)=A2-3,A2-3,"HELP"))))
    Copy/Paste the formula in C2 all the way down to the end of you date column range.

    *the explanation for using "workday() to validate a ref date comes from here: exceljet {dot} net/formula/date-is-workday
    the closest solution I saw to what I did here had the user creating a column of EVERY DAY of the year and then validating if it was a payday...oy!

    Hope this helps someone else!

    -Borgem

  14. #14
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Conditional formatting based on bi-monthly payday criteria

    borgem, welcome to the forum, and thanks for the input

+ 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. Conditional Formatting based on Monthly Budgets
    By rz6657 in forum Excel General
    Replies: 3
    Last Post: 05-25-2016, 06:11 PM
  2. [SOLVED] Conditional formatting based on criteria
    By fscutaro in forum Excel General
    Replies: 7
    Last Post: 12-08-2015, 03:31 PM
  3. [SOLVED] Conditional Formatting - Based on Criteria
    By mlbdc2012 in forum Excel General
    Replies: 2
    Last Post: 02-03-2015, 05:50 PM
  4. [SOLVED] Conditional Formatting Based on Two Criteria (Using VBA)
    By macrorookie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-07-2014, 07:19 PM
  5. [SOLVED] Conditional formatting based on two criteria
    By Brumbot in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-24-2013, 05:44 AM
  6. [SOLVED] Conditional Formatting based on 2 criteria
    By SantosJ in forum Excel General
    Replies: 2
    Last Post: 05-23-2012, 05:11 AM
  7. Conditional Formatting based on 2 Criteria
    By SteelDog in forum Excel General
    Replies: 3
    Last Post: 06-23-2008, 12:58 AM

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