Index/Match/Max Tenure

Airam

New Member
Joined
Jun 23, 2010
Messages
19
Good day

I was trying to get a tenure using a specific value in array. The Formula I'm using works fine but I encounter issue when the criteria I was looking for has a duplicate in Row

What I am trying to obtain is to get the tenure of an employee using the most recent data in a the array.

Table 1:
This is when the value ("-N1") doesn't have duplicate in a Row.
I was able to get accurate result which reflects in Column B

ABCDEFGHI
NAMETenureStatus01/21/201801/28/201802/04/201802/11/201802/18/201802/25/2018
Employee A157ActiveRIB-S2-T1RIB-S2-T2RIB-S2-T3RIB-S2-N1RIB-S2-N2

<tbody>
</tbody>







Formula Used to get the tenure (Column B):

=IFERROR(DATEDIF(IF(C2="Active",INDEX($D:$I,1,MATCH("*-N1*"D2:I2,0))),""),TODAY(),"D"),"")

<tbody>
</tbody>


Table 2:
The value ("-N1") have duplicate in a Row (G2 & M2). What I need is for the computation of tenure to be based on Column M2


ABCDEFGHIJKLMNO
NAMETenureStatus1/21/20181/28/20182/4/20182/11/20182/18/20182/25/20187/15/20187/22/20187/29/20188/5/20188/12/20188/19/2018
Employee AActiveRIB-S2-T1RIB-S2-T2RIB-S2-T3RIB-S2-N1


RIB-S2-N2CAR-S2-T1CAR-S2-T2CAR-S2-T3CAR-S2-N1CAR-S2-N2CAR-S2-N3

<tbody>
</tbody>








Hoping for your help on this.
 
Last edited:

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
This reports the maximum date from Row4 where the Status is Active and there is -N1 contained in the code. You will notice that the difference between today (jul18/2080) and aug5/201) is negative eighteen days.


Book1
ABCDEFGHIJKLMNO
4NAMETenureStatus1/21/181/28/182/04/182/11/182/18/182/25/187/15/187/22/187/29/188/05/188/12/188/19/18
5Employee A-18ActiveRIB-S2-T1RIB-S2-T2RIB-S2-T3RIB-S2-N1RIB-S2-N2CAR-S2-T1CAR-S2-T2CAR-S2-T3CAR-S2-N1CAR-S2-N2CAR-S2-N3
Sheet16
Cell Formulas
RangeFormula
B5{=IF(C5="Active",TODAY()-MAX(IF(IFERROR(SEARCH("-N1",D5:O5),0),D4:O4,0)),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Thank you very much. :)

Is there a way that if a value is less than 1, it will return a blank. instead of showing the negative number (-18).
 
Upvote 0
Another follow up question is. If the status is not "Active" instead of False, how can I have the formula return as "Blank". Thank you very much in advance.
 
Upvote 0

Forum statistics

Threads
1,214,999
Messages
6,122,645
Members
449,093
Latest member
Ahmad123098

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