Writing a nested "If Statement" returning more than one set of values

FOOTED

New Member
Joined
Nov 19, 2015
Messages
6
Below is a sample of rows and columns of data in which I am trying to write a nested “if statement” that would calculate the number of service months based on the following conditions:
1. Employee’s birthdate must occur before they are eligible to enroll
2. The date eligible to enroll must occur either before or on 12/31/2013
3. There date of rehire must occur either on or before 12/31/2013
4. The period of time between their rehire date and there initial termination date must be = or less than 365 days.

However, if the employee was already eligible as indicated in Column AB the value that would need to be returned would be “Eligible”, and no months of service needs to be calculated.

Column N
Date TM Attains Age 19
Row 1 6/1/2014
Row 2 4/1/2011

Column Z
Date Eligible to Enroll
Row 1: 10/1/2014
Row 2: 4/1/2013

Column X
Hire Date
Row 1: 12/9/2013
Row 2: 6/8/2012

Column AA
Initial Termination Date
Row 1: 12/26/2013
Row 2: 8/3/2012

Column AB
1st Hire Eligibility
Row 1: Eligible
Row 2: Not Eligible

Column AD
Rehire Date
Row 1: 1/14/2015
Row 2: 7/20/2013


I have written the following formula, which would calculate the number of months of service or return a value of “Not Eligible”, but if the employee was already eligible as indicated in Column AB none of these additional calculations would be required, but don’t know how to write a formula that would first look for the value in Column AB and then if AB shows Not Eligible then calculate the number of months based on the above conditions being met or return a value of Not Eligible.
=IF(AND($Z5136>=$N5136,Z5136<=DATE(2013,12,31),AD5136<=DATE(2013,12,31),(AD5136-AA5136)<=365,AB5136="Not Eligible"),DATEDIF(X5136,AD5136,"m"),"Not Eligible")
Any help would be greatly appreciated.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hi,

If your formula is already working for calculating number of months of service, and only need to check for "Eligible" in column AB, try:

Rich (BB code):
=IF($AB5136="Eligible","Eligible",IF(AND($Z5136>=$N5136,Z5136<=DATE(2013,12,31),AD5136<=DATE(2013,12,31),(AD5136-AA5136)<=365,AB5136="Not Eligible"),DATEDIF(X5136,AD5136,"m"),"Not Eligible"))
 
Last edited:
Upvote 0
Use this:

Code:
=IF(AB5136="Eligible","Eligible",IF(N5136<Z5136,IF(Z5136<=DATE(2013,12,31),IF(X5136<=DATE(2013,12,31),IF(AD5136-AA5136<=365,ROUND((DAYS360(X5136,AD5136,FALSE))/30,0),"Not Eligible")))))
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,583
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top