LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John
 
Posts: n/a
Default Formula to Check Values between to variables

I wish to create a fomula that will return either "Yes" if an employee is
clocked in for a particular set hour and "No" if they are not

Cell K2 = Clockin Time i.e. start time
Cell L2 = Clockout Time i.e. finish time
Cell B2 = Date (as the clockin and clock out is formatted in dd/mm/yy
hh:mm:ss, wheras P1 is hh:mm:ss only)

Cells P1 to AM2 = Possible working hours for the Day

I wish to enter my required formula that will return either "Yes" or "No" in
Cells P2 to AM2. I have used the following formula but its given me an
incorrect value for the hour an employee finishes.

=IF(AND($K2<($B2+P1),$L2($B2+P1)),"Yes","No")

My logic is that IF the start time is less than the specific hour I am
checking AND the finish time is greater THEN "Yes" - the employee must be
working, otherwise "No"

The problem in my logic is that always in the last hour the employee works
my formula will return "No" as L2 will never be greater than (B2+P1)

This seems simple but my brain has turned to jelly, any suggestions?

Thanks


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Positioning Numeric Values Resulting from 6 Column Array Formula Sam via OfficeKB.com Excel Worksheet Functions 2 January 5th 06 02:03 AM
Formula for Returning values in another spreadsheet lrbest4x4xfar Excel Worksheet Functions 1 October 14th 05 02:52 PM
How do you display the values of variables within an Excel formula curious one Excel Discussion (Misc queries) 1 March 3rd 05 02:52 PM
Formula to compare multiple rows values based on another column? Murph Excel Worksheet Functions 4 February 21st 05 02:44 AM
Creating Formula using check boxes Anthony Slater Excel Discussion (Misc queries) 3 January 4th 05 03:03 PM


All times are GMT +1. The time now is 08:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"