+ Reply to Thread
Results 1 to 9 of 9

Formula check if in between time range from 2 data

  1. #1
    Registered User
    Join Date
    05-11-2016
    Location
    Malaysia
    MS-Off Ver
    2007
    Posts
    11

    Lightbulb Formula check if in between time range from 2 data

    Hi Guys,

    How to check the provided timing was within 10:00 PM to 6:00 AM?

    For example an employee key in the overtime From and To was 9:00 PM to 7:00 AM, is there a formula to auto show as "Yes/True" or "No/False"?

    Thank you so much!!~

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Formula check if in between time range from 2 data

    Attach example EXCEL file (not a picture, pasted text or any other than Excel format!). This file should be attached to a new post. Never change your original post (except admin's request).

    In attached Excel file try not to use:
    • merged cells
    • password protection
    • autorun VBA code
    • unnecessary formatting like: colours, borders, aligning another than default, etc...
    • unnecessary zooming/grouping/freezeing
    You have words to logically describe the problem

    To attach an Excel file to your post,
    • desensitize data
    • remeber that your example should reflect structure and type of data and contain the result what you want to achieve (manually created if necessary)
    • click Go Advanced,
    • scroll down until you see Manage Attachments,
    • click that and select Browse,
    • select your file and click Open,
    • click Upload and you will see your attachment below Upload Files from a website
    • click Close this window,
    • click Submit reply

    After that you should see attachment in your post

  3. #3
    Registered User
    Join Date
    05-11-2016
    Location
    Malaysia
    MS-Off Ver
    2007
    Posts
    11

    Re: Formula check if in between time range from 2 data

    Ok here's the file.

    I need to manual key in the highlighted part currently, is there a way to make a formula for auto calculation? T_T
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    514

    Re: Formula check if in between time range from 2 data

    Try these:

    Cell E10 =MEDIAN($B$5,$C$5,C10+(B10>C10))-MEDIAN($B$5,$C$5,B10)+MEDIAN($B$5,$C$5,C10+(B10>C10)-1)-$B$5
    Cell G10 =IF(E10<D10,"Yes","No")

  5. #5
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,174

    Re: Formula check if in between time range from 2 data

    Try in E10:

    =IF(B10="","",IF(B10>C10,MAX(0,C10-$B$5)+MAX(0,$C$5-B10),MIN(C10,$C$5)-MAX(B10,$B$5)))

  6. #6
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    514

    Re: Formula check if in between time range from 2 data

    @ Phuocam:

    Your solution stumbles on:
    5:00 AM - 4:00 AM (returns 17:00 instead of 16:00)
    4:00 AM - 4:00 AM (returns negative 2:00 instead of 0:00)

  7. #7
    Registered User
    Join Date
    06-04-2017
    Location
    India
    MS-Off Ver
    2013
    Posts
    54

    Re: Formula check if in between time range from 2 data

    Use this formula
    =IF(AND(B10<$B$5,C10<$B$5),0,IF(D10-1>$B$5,MIN($C$5,D10)-MAX($B$5,B10)+D10-1-$B$5,MIN($C$5,D10)-MAX($B$5,B10)))

  8. #8
    Registered User
    Join Date
    05-11-2016
    Location
    Malaysia
    MS-Off Ver
    2007
    Posts
    11

    Re: Formula check if in between time range from 2 data

    How about this?
    my head going to crack soon..
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,174

    Re: Formula check if in between time range from 2 data

    @Root_

    You're right!

+ 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] Check if range of time falls in another range of time
    By wafs in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-18-2018, 06:47 PM
  2. [SOLVED] Formula check if in between time range from 2 data
    By BuzyxBuddy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-14-2018, 07:48 AM
  3. Check if event occurs within time range
    By excellinginlife in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 09-20-2016, 10:43 AM
  4. [SOLVED] if formula to check a criteria in a range of data within a column
    By rajeshmarndi in forum Excel General
    Replies: 2
    Last Post: 07-10-2016, 09:47 AM
  5. [SOLVED] Formula that check for duplicate data in a column range
    By eugh in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-12-2012, 02:57 AM
  6. Replies: 4
    Last Post: 08-04-2011, 03:54 PM
  7. Check value in a time range
    By badin in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-25-2008, 06:31 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