+ Reply to Thread
Results 1 to 10 of 10

Highlighting of the hour range

  1. #1
    Registered User
    Join Date
    01-22-2022
    Location
    Rzeszów,Poland
    MS-Off Ver
    365
    Posts
    38

    Red face Highlighting of the hour range

    Hi,

    I got excel file and want to create mechanism to highlight cells.

    1.PNG

    When I put hours from range for example 10-18, there should be highlighted hours falling within this range.
    2.PNG

    How to do it?
    Could you help me with below question?
    Thanks
    Andrew

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,812

    Re: Highlighting of the hour range

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    01-22-2022
    Location
    Rzeszów,Poland
    MS-Off Ver
    365
    Posts
    38

    Re: Highlighting of the hour range

    Thank you Ali.
    I have attached excel file.
    Br
    Andrew
    Attached Files Attached Files

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Highlighting of the hour range

    One way, using this as the CF formula:

    =AND(-LOOKUP(1,-LEFT(C$1,ROW($1:$3)))>=$A$3,-LOOKUP(1,-LEFT(C$1,ROW($1:$3)))<=$B$3)
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,740

    Re: Highlighting of the hour range

    EDIT - Ignore , already answered with a better solution then mine

    are you just putting one set of entries into the sheet

    I have a way of doing it - but it will need a change from 23-0 to be 24-24
    is that acceptable

    so using a formula
    =AND($A3<=LEFT(C$1,FIND("-",C$1,1)-1)*1,$B3>=RIGHT(C$1,CHOOSE(LEN(C$1),0,0,0,0,1,2,2))*1)

    in conditional formatting


    OR did you want the ROW with the times highlighted

    Pictures are different to sample sheet
    and no expected results

    if you want the row that you enter the data to be used
    same formula just a different way to apply

    theres a lot of working , showing the development of the formula
    and then the formula also in row3 - which isnt necessary - BUT shows the true/false how cond frmt would see it
    Attached Files Attached Files
    Last edited by etaf; 01-22-2022 at 12:37 PM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  6. #6
    Registered User
    Join Date
    01-22-2022
    Location
    Rzeszów,Poland
    MS-Off Ver
    365
    Posts
    38

    Re: Highlighting of the hour range

    Hi Glenn, Thanks you very much for your tip.
    Could you please also clarify me in below questions?
    Where can I see this CF formula in spreadsheet.
    What should I change in this formula because now I see one hour too much( I set 10-15 and see range 10-16)
    Attachment 764887

    br
    Andrzej

  7. #7
    Registered User
    Join Date
    01-22-2022
    Location
    Rzeszów,Poland
    MS-Off Ver
    365
    Posts
    38

    Re: Highlighting of the hour range

    Hi Wayne,
    Thanks for your help!
    br
    Andrew

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Highlighting of the hour range

    Formula modified and is found here.. with any cell(s) in the block C2:Z62 selected

    Home/Styles/Conditional Formatting/Manage Rules/edit rule.

    Did you want this applied to the bLOCK or on a row-by row basis??
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    01-22-2022
    Location
    Rzeszów,Poland
    MS-Off Ver
    365
    Posts
    38

    Re: Highlighting of the hour range

    Glenn, now I know everything and works properly.
    Thanks
    Br
    Andrzej

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Highlighting of the hour range

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please select "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.

+ 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. Highlighting a range of cells based on a range of values
    By Mitesh_Za in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-29-2021, 10:47 AM
  2. [SOLVED] Calculating Each Hour Worked by Multiple Employees to get the total Cost of Each Hour
    By cs25001 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-06-2019, 06:55 AM
  3. Replies: 0
    Last Post: 03-07-2014, 11:26 AM
  4. [SOLVED] Countif / Sumif Range in a 24 Hour Time Range
    By cwwazy in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-16-2013, 04:18 PM
  5. [SOLVED] How to make Hour range
    By nelkin in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-03-2013, 10:45 AM
  6. How do I? Hour by Hour Occurrences between a Date Range?
    By lesoies in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-06-2013, 09:01 PM
  7. Find hour in a range of hour values
    By mqdias in forum Excel General
    Replies: 2
    Last Post: 04-11-2011, 05:06 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