In this article, we will learn how to determine whether a worked shift was morning, afternoon or night in Microsoft Excel 2010.
To find a formula to determine whether an employee worked in morning, afternoon or night shift, we will use IF & LOOKUP functions to get the output.
The IF function checks if a condition you specify is TRUE or FALSE. If the condition returns TRUE then it returns preset value, and if ion returns FALSE then it returns another preset value.
Syntax = IF(logical_test,value_if_true,value_if_false)
logical_test: Logical test will test the condition or criteria, if condition meets then it returns the preset value, and if the condition does not meet then it returns another preset value.
value_if_true: The value that you want to be returned if this argument returns TRUE.
value_if_false: The value that you want to be returned if this argument returns FALSE
LOOKUP: Looks up a value either from a one-row or one-column range or from an array. Provided for backward compatibility.
lookup_value: A value that LOOKUP function searches for in the lookup vector.
lookup_vector: A range that contains only one row or one column.
Note: Values in lookup_vector must be placed in ascending order (1,2,3 or a,b,c). Otherwise lookup function will return the error value.
result_vector: This is optional. A range that contains only one row or column. The result_vector argument must be of the same size as lookup_vector.
Let us take an example:
The second method is to use LOOKUP function.
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.