+ Reply to Thread
Results 1 to 8 of 8

Need help in IF formula with multiple time stamp ranges to extract S/Leave and Half Day

  1. #1
    Forum Contributor
    Join Date
    01-09-2019
    Location
    Karachi, Pakistan
    MS-Off Ver
    MS 365
    Posts
    124

    Need help in IF formula with multiple time stamp ranges to extract S/Leave and Half Day

    Dear Experts,

    I tried so many times but cant get the formula what to use for it. i am sure my experts Excelforum family will help me out from this confusing scenario. below is the explanation what kind of formula i need to add also attaching a file.

    I need to extract Short Leave and Half Day from the IN and OUT timings.

    if IN time is before 8:30 AM than show me on time or blank.
    if IN time is greater than 8:30 AM and before 10:10 AM it will consider Short Leave.
    if IN time is greater than 12:10 PM it will be Half Day. Same for the OUT.
    if OUT time is greater than 15:10 PM it will be Short Leave.

    Thanks in advance for your precious time and help.
    Attached Files Attached Files
    Last edited by Waqas Gul; 06-23-2022 at 10:19 AM.

  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
    79,368

    Re: Need help in IF formula or any suitable formula

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    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
    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
    79,368

    Re: Need help in IF formula with multiple time stamp ranges to extract S/Leave and Half Da

    Thanks for the title change.

  4. #4
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Need help in IF formula with multiple time stamp ranges to extract S/Leave and Half Da

    I'm struggling to make sense of your criteria:

    IN:
    8:30 or earlier = "On Time" (but row 19 is marked as Short Leave for IN at 08:10?)
    8:30 to 10:10 = "Short Leave"
    10:10 to 12:10 = "Short Leave" as well? As per row 16?
    After 12:10 = "Half Day"

    OUT
    15:10 or later = "On Time"
    12:10 to 15:10 = "Short Leave"? But row 14 marked as Half Day for 15:00? And row 20 marked as On Time for 13:25?
    Before 12:10 = "Half Day"?

  5. #5
    Forum Contributor
    Join Date
    01-09-2019
    Location
    Karachi, Pakistan
    MS-Off Ver
    MS 365
    Posts
    124

    Re: Need help in IF formula with multiple time stamp ranges to extract S/Leave and Half Da

    I am Sorry and Thanks @nick.williams for correcting me.

    i am attaching revised file where i did mistake.
    Last edited by Waqas Gul; 06-23-2022 at 10:20 AM.

  6. #6
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Need help in IF formula with multiple time stamp ranges to extract S/Leave and Half Da

    You haven't made it particularly clear, in your latest example you have changed it so now there are no times in the range 10:10 to 12:10.

    Also for OUT you say "after 12:10 PM will consider half day" and "after 15:10 PM will consider Short Leave"...I presume you mean before, not after?

    Anyway I think the easiest is if you make some reference tables then it's asy to change to what you want. So I made a table for IN stating in J17:

    Start End Description
    00:00 08:30 On Time
    08:31 10:10 Short Leave
    10:11 12:10 Short Leave
    12:11 23:59 Half Day

    and a table for OUT starting in N17:

    Start End Description
    00:00 12:09 Half Day
    12:10 15:09 Short Leave
    15:10 23:59 On Time

    Then in D10 you can use the forumla:

    =IF(C10="IN",LOOKUP(B10,$J$18:$J$21,$L$18:$L$21),LOOKUP(B10,$N$18:$N$20,$P$18:$P$20))

    and copy down to other cells. See attached file.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    01-09-2019
    Location
    Karachi, Pakistan
    MS-Off Ver
    MS 365
    Posts
    124

    Re: Need help in IF formula with multiple time stamp ranges to extract S/Leave and Half Da

    Great Help.... Bundle of Thanks @nick.williams , Now i can change time range by myself and all work great. really great.
    Last edited by AliGW; 06-24-2022 at 03:27 AM. Reason: PLEASE don't quote unnecessarily!

  8. #8
    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
    79,368

    Re: Need help in IF formula with multiple time stamp ranges to extract S/Leave and Half Da

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank those who have helped you by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

+ 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] looking for suitable vba to supercede formula that is a slow coach
    By MannStewart in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 11-14-2020, 12:47 AM
  2. Vlookup is not working help me with any other formula for this
    By vimalanathk in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-19-2019, 01:53 AM
  3. formula for this?
    By vimalanathk in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-21-2016, 03:20 AM
  4. Filling the cell with the data in second sheet
    By azbi in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-20-2015, 01:12 AM
  5. Suitable formula function to make solution
    By iqubalemco in forum Excel - New Users/Basics
    Replies: 16
    Last Post: 09-28-2014, 11:57 PM
  6. HELP Using the =if formula (or a more suitable one for my needs).
    By tomow87 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-18-2014, 11:51 PM
  7. [SOLVED] What is the suitable formula if getting error: #VALUE!
    By umais41 in forum Excel General
    Replies: 4
    Last Post: 12-31-2012, 03:19 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