+ Reply to Thread
Results 1 to 11 of 11

Cell color base on Odd/Even Week and Day criteria

  1. #1
    Registered User
    Join Date
    05-25-2010
    Location
    colorado, USA
    MS-Off Ver
    Excel 2003
    Posts
    12

    Cell color base on Odd/Even Week and Day criteria

    I have been searching around and just cannot find a way to deal with this much less find a way to start. I have a column representing each date of the month. I would like the cells beneath to color grey as to whether the date is a Monday and is in an even week and if the code to the left of the employee is "EM" (which stands for even Monday). I would ultimately want the same for even week Mondays, odd week Fridays, etc. depending on the code beside the employee name.

    I attached a spreadsheet that shows what I am trying to accomplish. Any assistance is greatly appreciated!!!
    Attached Files Attached Files

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Cell color base on Odd/Even Week and Day criteria

    Maybe a conditional format formula of the form

    =AND(WEEKDAY(H$3,2) = 1,ISEVEN(WEEKNUM(H$3)),$A6= "EM")

    might help.

  3. #3
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Cell color base on Odd/Even Week and Day criteria

    Hi,

    Select all the cells from C6:AG100, then select Conditional Formatting --> New Rule... --> Use a formula to determine which cells to format, and enter this formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I hope this helps
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Cell color base on Odd/Even Week and Day criteria

    @Martin: your solution would only accommodate even Mondays, but doesn't consider the odd Fridays and odd Mondays shown in the example.

    @excelforumcrisis: my formula will only fall apart if you use something like "OT", which could mean odd Tuesday or Thursday. Let me know if either of these scenarios are likely, and if so I will adjust my formula to accommodate for this

  5. #5
    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
    53,051

    Re: Cell color base on Odd/Even Week and Day criteria

    If the category is already "EM" (which stands for even Monday), why not just test for that?
    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

  6. #6
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Cell color base on Odd/Even Week and Day criteria

    Those would be additional conditional formats in the style of the example or conceivably one more complex formula with an OR function.

  7. #7
    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
    53,051

    Re: Cell color base on Odd/Even Week and Day criteria

    @ martin, it seems as if that code will be there anyway (EM), thats why I asked

  8. #8
    Registered User
    Join Date
    05-25-2010
    Location
    colorado, USA
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Cell color base on Odd/Even Week and Day criteria

    Thank you all for helping! I chose what ajryan88 provided and it worked great! I just do not understand the formula. Can you explain it a little so I understand what it is doing? I am self taught and would very much wish to understand what you came up with.

  9. #9
    Registered User
    Join Date
    05-25-2010
    Location
    colorado, USA
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Cell color base on Odd/Even Week and Day criteria

    Actually I just figured out what you did ajryan88. That was very clever and nothing I certainly would have thought of! Thanks again!

  10. #10
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Cell color base on Odd/Even Week and Day criteria

    Sure - I had envisaged that the 'applies to' area would be all the columns and not just those which were Mondays.

  11. #11
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Cell color base on Odd/Even Week and Day criteria

    I am glad I could help

    Please don't forget to mark this thread as solved, and please click on the * next to any post(s) that were helpful to say thanks to the poster(s) and add to their reputation

+ 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. [SOLVED] Alternate row color base on cells' criteria
    By alexnkc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-22-2013, 08:17 AM
  2. [SOLVED] Macro to automatically change tab color to red base on a cell date
    By Chaunceycat in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-10-2012, 07:53 PM
  3. [SOLVED] Change cell color base on criterias from multible comboboxes !
    By Petter120 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-05-2012, 05:34 AM
  4. cell values base on cell color
    By johncena in forum Excel General
    Replies: 6
    Last Post: 02-23-2010, 05:01 AM
  5. [SOLVED] Sumif and base it on font color of cell
    By Bruce in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-28-2005, 06:05 PM

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