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

1. ## 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.

2. ## Re: Need help in IF formula or any suitable formula

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.)

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

Thanks for the title change.

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

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

7. ## 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.

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

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.

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### 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