+ Reply to Thread
Results 1 to 7 of 7

Search to data ranges and highlight matches

Hybrid View

  1. #1
    Registered User
    Join Date
    08-14-2013
    Location
    Victoria, Australia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Search to data ranges and highlight matches

    Hi Excel Guru's

    I'm trying to create a leave calendar for staff. I would like to paste in the staff members sick and annual leave dates.

    I would then like a conditional format that would highlight the leave dates onto the calendar, so i can visually track attendance and check for any sick leave patterns. My calendar looks like below for each month, and although it shows just the date in excel, i have formatted it so its actually the full date (ie instead of 1 it is 1/7/2013, but just displaying 1)

    Jul-13
    M T W T F S S
    1 2 3 4 5 6 7
    8 9 10 11 12 13 14
    15 16 17 18 19 20 21
    22 23 24 25 26 27 28
    29 30 31

    Whilst i can easily track and input the public holidays (on an individual basis) i'm looking to highlight the whole calendar area, say cells (c5:i10) as the search area and then have the leave data as a whole search area (at2:at150)

    Above is part A of my question. To further complicate it, if it can even be done. The leave data i get from my system only has the start date of the leave, in another column it has the end date, and in another column it has days absent, if we can do it so it adds the days after (total leave days) to highlight in the calendar that would be amazing, if not, i'll just amend the data to have every date of the leave listed

    Leave Type Start Date End Date Days Taken


    Thanks guys

  2. #2
    Valued Forum Contributor
    Join Date
    09-07-2006
    Posts
    520

    Re: Search to data ranges and highlight matches

    This illustrates how to apply CF based on a range of dates, viz: Start date to End date
    Assuming the Start date is entered in AU3, End date in AV3
    Select C5:I10 (ie your calendar area which is presumed to contain real dates)
    Apply CF using the formula: =AND(C5>=$AU$3,C5<=$AV$3)
    Format to suit > OK

    Note that both Start date and End date should always be populated, if the leave is only for 1 day, then the same date should be entered into both Start / End date cells
    ---------------------------
    Any worth? Wave it, hit the little star at the bottom left of my response

  3. #3
    Registered User
    Join Date
    08-14-2013
    Location
    Victoria, Australia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Search to data ranges and highlight matches

    Hi Max,

    Thank you for the response, whilst that works for one line of leave data, i will have a full year of information not just one line (AT2:AU50) for example. Then for another layer of complication at some point i'll have to consider the different types of leave.... :| but one problem at a time....

    Leave Type Start Date End Date
    SICK LEAVE 25/07/2013 31/07/2013
    ANNUAL LEAVE 31/07/2013 31/07/2013
    SICK LEAVE 15/08/2013 15/08/2013
    ANNUAL LEAVE 23/08/2013 23/08/2013
    SICK LEAVE 29/08/2013 29/08/2013
    SICK LEAVE 30/08/2013 30/08/2013
    SICK LEAVE 30/08/2013 30/08/2013
    SICK LEAVE 17/09/2013 17/09/2013
    SICK LEAVE 17/09/2013 17/09/2013

  4. #4
    Valued Forum Contributor
    Join Date
    09-07-2006
    Posts
    520

    Re: Search to data ranges and highlight matches

    You could use something like this as the CF formula
    =SUMPRODUCT((C5>=$F$5:$F$6)*(C5<=$G$5:$G$6))>0
    where the Start dates and End Dates are in ranges F5:F6, G5:G6
    ---------------------------------
    Any worth?

  5. #5
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Search to data ranges and highlight matches

    You might be able to take advantage of Pivot Tables and Charts like the enclosed.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  6. #6
    Registered User
    Join Date
    08-14-2013
    Location
    Victoria, Australia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Search to data ranges and highlight matches

    Thank you for the response Newdoverman!

    However we are trying to develop a tool that highlights any patterns in leave. ie is the employee always taking a monday off work. Which is why i was looking at highlighting the dates off the data we obtain from the system

    Thank you though

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Search to data ranges and highlight matches

    Perhaps you could use Conditional Formatting within a Table that will allow you to bring up from a single employee to as many as you like as well as filter on other criteria.

+ 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. Search range of strings with a range of keywords and highlight matches
    By efillner in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-12-2013, 04:07 PM
  2. Search array and highlight array matches
    By ricklou in forum Excel General
    Replies: 3
    Last Post: 12-19-2012, 02:29 PM
  3. Replies: 2
    Last Post: 11-21-2012, 07:27 AM
  4. Compare two named ranges and highlight matches
    By jbmerrel in forum Excel General
    Replies: 1
    Last Post: 12-29-2011, 06:53 PM
  5. Search 4 ranges and copy all matches
    By SarahPintal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2010, 09:16 PM

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