How to find 1st instance, 2nd Instance for a unique ID based on date

Kiatsu

New Member
Joined
Mar 8, 2018
Messages
3
I have the following table sample. I need to indicate in the Shipment column,the first time something with the unique ID , the 2nd.. etc. it has to be based on date and not location in the sheet. And if the ID does not repeat then it is the 1st shipment.

[TABLE="width: 411"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]ID[/TD]
[TD]Ship Date [/TD]
[TD]Repeat[/TD]
[TD]Shipment[/TD]
[/TR]
[TR]
[TD]AST897P[/TD]
[TD="align: right"]10/4/2017[/TD]
[TD]No[/TD]
[TD]1st[/TD]
[/TR]
[TR]
[TD]AST1087[/TD]
[TD="align: right"]11/7/2017[/TD]
[TD]Yes[/TD]
[TD]1st[/TD]
[/TR]
[TR]
[TD]AST1087[/TD]
[TD="align: right"]11/23/2017[/TD]
[TD]Yes [/TD]
[TD][/TD]
[/TR]
[TR]
[TD]GRP911[/TD]
[TD="align: right"]12/10/2017[/TD]
[TD]No[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]GRP795[/TD]
[TD="align: right"]10/27/2017[/TD]
[TD]No[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]BHY902[/TD]
[TD="align: right"]10/27/2017[/TD]
[TD]Yes[/TD]
[TD]2nd[/TD]
[/TR]
[TR]
[TD]BHY902[/TD]
[TD="align: right"]11/22/2017[/TD]
[TD]Yes[/TD]
[TD]3rd[/TD]
[/TR]
[TR]
[TD]BHY902[/TD]
[TD="align: right"]9/25/2017[/TD]
[TD]Yes[/TD]
[TD] 1st[/TD]
[/TR]
[TR]
[TD]GYT214[/TD]
[TD="align: right"]9/25/2017[/TD]
[TD]No[/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
try:

<b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">D2</th><td style="text-align:left">=COUNTIFS(<font color="Blue">A$2:A$10,A2,B$2:B$10,"<"&$B2</font>)+1</td></tr></tbody></table></td></tr></table><br />


Excel 2013/2016
ABCD
1IDShip DateRepeatShipment
2AST897P10/4/2017No1
3AST108711/7/2017Yes1
4AST108711/23/2017Yes2
5GRP91112/10/2017No1
6GRP79510/27/2017No1
7BHY90210/27/2017Yes2
8BHY90211/22/2017Yes3
9BHY9029/25/2017Yes1
10GYT2149/25/2017No1
Sheet1
 
Upvote 0
Use SUMPRODUCT like this:


Book1
ABCD
1IDShip DateRepeatShipment
2AST897P10/4/2017No1
3AST108711/7/2017Yes1
4AST108711/23/2017Yes2
5GRP91112/10/2017No1
6GRP79510/27/2017No1
7BHY90210/27/2017Yes2
8BHY90211/22/2017Yes3
9BHY9029/25/2017Yes1
10GYT2149/25/2017No1
Sheet2
Cell Formulas
RangeFormula
D2=1+SUMPRODUCT(($A$2:$A$10=$A2)*($B$2:$B$10<$B2))


WBD
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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