Hello,
My goal is to pull the first and second appropriate date in column E if the ID number occurs a second time in column D.
The formula I am using is always pulling the second date if it exists. I thought I could use IFERROR or ISERROR on SMALL so if not found, it would use the traditional INDEX and MATCH. That didn’t work for me either.
Any ideas?
Thanks in advance
My goal is to pull the first and second appropriate date in column E if the ID number occurs a second time in column D.
The formula I am using is always pulling the second date if it exists. I thought I could use IFERROR or ISERROR on SMALL so if not found, it would use the traditional INDEX and MATCH. That didn’t work for me either.
Any ideas?
Thanks in advance
Book1 | ||||||||
---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | |||
1 | Individual Wkbk | MASTER | ||||||
2 | Product ID | Date | Product ID | Date | ||||
3 | 145 | 2/5/2019 | 145 | 2/7/2019 | 2/7/2019 | |||
4 | 6942 | 2/6/2019 | 6942 | 2/6/2019 | ||||
5 | 145 | 2/7/2019 | 145 | 2/7/2019 | ||||
6 | 662 | 2/8/2019 | 662 | 2/11/2019 | ||||
7 | 1957 | 2/9/2019 | 1957 | 2/9/2019 | ||||
8 | 818 | 2/10/2019 | 818 | 2/10/2019 | ||||
9 | 662 | 2/11/2019 | 662 | 2/11/2019 | ||||
10 | 6349 | 2/12/2019 | 6349 | 2/12/2019 | ||||
11 | 6169 | 2/13/2019 | 6169 | 2/13/2019 | ||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
F3 | F3 | {=IFERROR(INDEX($B$3:$B$11,SMALL(IF($A$3:$A$11=D3,ROW($B$3:$B$11)-ROW($B$3)+1,ROW($E$11)+1),2),1),INDEX($B$3:$B$11,MATCH(D3,$A$3:$A$11,0),0))} |
B4:B11 | B4 | =B3+1 |
E3:E11 | E3 | {=IF(COUNTIF($D$3:$D$11,D3)>1,INDEX($B$3:$B$11,SMALL(IF($A$3:$A$11=D3,ROW($B$3:$B$11)-ROW($B$3)+1,ROW($E$11)+1),2),1),INDEX($B$3:$B$11,MATCH(D3,$A$3:$A$11,0),0))} |
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces. |