+ Reply to Thread
Results 1 to 13 of 13

Highlight Holidays

  1. #1
    Registered User
    Join Date
    12-14-2013
    Location
    US
    MS-Off Ver
    Excel 2011
    Posts
    55

    Highlight Holidays

    So I have this grid. I was trying to get a conditional formatting to work by just typing in the dates of the federal holidays I want to shade but no matter what I did, 12/28, 12/28/2014, 12/28/14 (just as an example day) it wouldn't highlight. I was using the "cell contains specific text"

    Is there a different way to make it so the holidays are highlighted? In an ideal world, I'd be able to change the year and it do it automatically.
    Attached Files Attached Files

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

    Re: Highlight Holidays

    You didnt provide your table of holidays, so I made 1 up and put it in R6:R14

    Then...
    Highlight the range you want to apply the CF to
    Used New Rule/Use Formula
    copy this formula in...
    =VLOOKUP(B6,$R$6:$R$14,1,0)
    Format Fill as required

    Oh and by the way, check your CF rules, you have them repeated multiple times
    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
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Highlight Holidays

    Hi,


    you could list in a range (r1:r100) holidays and apply a new rule to activate conditional formatting

    =MATCH(B5,$R$1:$R$100,0)


    Just for sharing some ideas


    Edit: sorry Ford, I did not mean to overlap (same approach)
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  4. #4
    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,929

    Re: Highlight Holidays

    hahaha canapone, we both used exactly the same column for the search, and you didnt "overlap, we posted the same time besides, its always good to see different approaches

    and by the way, I know Im 12 too late, but congrats on reaching the 1K mark !!

  5. #5
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Highlight Holidays

    Ciao Ford,

    as you can read I'm not sure if CF must be disturbed to highlight numbers or dates themselves

    (Forgive my low profile English )

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

    Re: Highlight Holidays

    CF works on a TRUE or FALSE answer. So if my vlookup() or your match() returns an error, that is treated as FALSE, any "answer" will be true

  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
    52,929

    Re: Highlight Holidays

    Thanks for the feedback

  8. #8
    Registered User
    Join Date
    12-14-2013
    Location
    US
    MS-Off Ver
    Excel 2011
    Posts
    55

    Re: Highlight Holidays

    Thank YOU!

    Quick followup...I fixed all those conditional formatting (i'm learning and didn't realize how messy it was!)

    Something I'm trying to figure out how to do, but not even sure how you'd call it. Is I want a drop down in like A1 that has years, 2012, 2013, 2014 etc. And depending on which year you select, a different date will pop up in cell, say B1. How would I go about that?


    To take it a step further I'd actually like to have 2 cells generate specific text when a year is selected. So to be clear, I'm trying to get it to say a specific text, which just happens to be a specific date assigned to each year. 2014 would be 12/28/13, 2015 would be 12/27/14, randomness like that.

    Would I use conditional formatting?

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

    Re: Highlight Holidays

    For the drop down, you would use data Validation.

    Click Data tab, data tools/Data Validation. Select List under "allow" and enter the years you want, eg 2010, 2011, 2012, 2013, 2014.

    to pull text based on what date is selected, again, you could put a small table together with date/text, then use vlookup to return the text

  10. #10
    Registered User
    Join Date
    12-14-2013
    Location
    US
    MS-Off Ver
    Excel 2011
    Posts
    55

    Re: Highlight Holidays

    Ok so I was able to do the list fine but I'm at a stump on how to incorporate the vlookup, would I use conditional formatting?

    I've attached a sample of what I have so far, if you look in AD you can see what I have as the list and then the to the right is what I want to reflect when that year is chosen and where I want that to be changed

    You guys have been great here, I have learned a crazy amount
    Attached Files Attached Files

  11. #11
    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,929

    Re: Highlight Holidays

    Ok try this for B4...
    =VLOOKUP($B$2,$AD$5:$AF$8,2,0)

    and then this for A2...
    =VLOOKUP($B$2,$AD$5:$AF$8,3,0)

  12. #12
    Registered User
    Join Date
    12-14-2013
    Location
    US
    MS-Off Ver
    Excel 2011
    Posts
    55

    Re: Highlight Holidays

    Awesome, that worked!

    You are a gift to this site

  13. #13
    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,929

    Re: Highlight Holidays

    Glad to help, and thanks for the kind words

+ 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. highlight holidays of the year
    By nooredein in forum Excel General
    Replies: 13
    Last Post: 05-11-2014, 01:59 PM
  2. [SOLVED] Highlight the list of holidays specified in the file
    By saravanan4778 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-30-2013, 07:59 AM
  3. Replies: 2
    Last Post: 12-05-2012, 07:01 AM
  4. Replies: 1
    Last Post: 06-02-2010, 01:24 AM
  5. Automatically highlight cells if weekends or holidays
    By shirleyczl in forum Excel General
    Replies: 1
    Last Post: 06-02-2010, 12:17 AM

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