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]
[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]