20171115

Excel - Nested functions


Nested Functions plays vital role in manipulating data with multiple conditions. Function in to functions is the global method of building complex or nested formulas.

=IF(AND((TODAY()-E2>=2000),(TODAY()-F2>=500)),"MASTER COACH", "COMPETENT"

In above example we used condition to identity the most tenured & experienced employee in given below table. To check the conditions we made use of three excel in-built functions



Function Type of Function Description
IF Logical Function IF Condition is TRUE than Perform Condition1, ELSE Perform Condtion2
AND Logical Function Separator of condition, AND is logical condition
TODAY Date/Time Function Subtract Today's Date from Employee Joining Date & Date of Birth

IF(AND((TODAY()-E2>=2000), (TODAY()-F2>=500))  
THEN Return Answer as "MASTER COACH" 
ELSE Return Answer as "COMPETENT"

Cust ID Employee Name Contact No Date of Birth JoiningDate Tenure(Days)
Nov101 Mohammad Henry 16390211-5173 31/03/1987 26/08/2014 1160
Nov102 Norman L. Joyner 16880622-8360 28/07/1961 14/06/2008 3392
Nov103 Katelyn Petty 16930620-2897 27/04/1968 16/09/2013 1500
Nov104 Suki Barr 16310419-4174 20/12/1970 14/11/2011 2162
Nov105 Brendan Carr 16060210-5298 07/04/1981 13/08/2008 3333
Nov106 Baxter J. Knowles 16861125-1722 01/07/1983 07/09/2009 2949
Nov107 Sarah Weiss 16580117-7147 26/07/1981 01/03/2016 615
Nov108 Eliana Whitaker 16351008-7533 12/01/1994 04/04/2013 1662
Nov109 Chastity Contreras 16710221-3076 15/05/1962 13/06/2007 3753
Nov110 Warren Fuentes 16880924-3150 04/07/1971 01/01/2011 2475
Nov111 Sybill Olson 16590105-8171 06/11/1979 09/11/2007 3607

Now Let us apply the same logic and find the result
IF
AND Condition1 Condition2
IS Dateof Birth >= 2000 IS Joining Date >= 500
SUM TODAY()-Dates 11018 1008
TRUE/FALSE TRUE TRUE
Result MASTER COACH


If we apply the formula to check - first condition is - IS Employee age >= 2000 days and Second condition is - IS Employee joined 500 days before, here both the conditions are satisfying for first employee, so he is "Master Coach"


No comments:

Post a Comment

Search This Blog

Reverse String using Excel VBA

Normally this is an interview question being asked by company technical recruiters. This is an logical question and every aspirants must b...