Hi
I've got three groups of data over 9 rows.
Each group has duplicates and I'd like to delete the duplicate rows based on data in column C, which has Cash Sales.
In the table below,
column A has Product IDs,
column B has Product Names,
column C has Cash Sales and
column D has the Group ID
If a duplicate row is in the data, as is the case with rows 2 and 3, I would like to delete the row where the Cash Sales in column C are either greater OR equal to the other row where there is a duplicate Product ID.
So with rows 2 and 3, row 2 would be deleted because the Cash Sales in column C for row 2 are 100.
Whilst the Cash Sales in column C for the same product in row 3 are 50.
Has anyone done this before? Any thoughts would be greatly appreciated! TIA
[TABLE="width: 470"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]Product ID[/TD]
[TD]Product Name[/TD]
[TD]Cash Sales[/TD]
[TD]Group ID[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]Nice Marmalade 70g[/TD]
[TD]100[/TD]
[TD]1234[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]Nice Marmalade 70g[/TD]
[TD]50[/TD]
[TD]1234[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Nice Jam 70g[/TD]
[TD]0[/TD]
[TD]1234[/TD]
[/TR]
[TR]
[TD]5678[/TD]
[TD]Cool Strawberry Juice 50ml[/TD]
[TD]200[/TD]
[TD]5678[/TD]
[/TR]
[TR]
[TD]5678[/TD]
[TD]Cool Strawberry Juice 50ml[/TD]
[TD]100[/TD]
[TD]5678[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Cool Orange Juice 50ml[/TD]
[TD]0[/TD]
[TD]5678[/TD]
[/TR]
[TR]
[TD]2345[/TD]
[TD]Great Raspberry 70ml[/TD]
[TD]500[/TD]
[TD]2345[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Great Grapefruit 70ml[/TD]
[TD]0[/TD]
[TD]2345[/TD]
[/TR]
[TR]
[TD]2345[/TD]
[TD]Great Raspberry 70ml[/TD]
[TD]500[/TD]
[TD]2345[/TD]
[/TR]
</tbody>[/TABLE]
I've got three groups of data over 9 rows.
Each group has duplicates and I'd like to delete the duplicate rows based on data in column C, which has Cash Sales.
In the table below,
column A has Product IDs,
column B has Product Names,
column C has Cash Sales and
column D has the Group ID
If a duplicate row is in the data, as is the case with rows 2 and 3, I would like to delete the row where the Cash Sales in column C are either greater OR equal to the other row where there is a duplicate Product ID.
So with rows 2 and 3, row 2 would be deleted because the Cash Sales in column C for row 2 are 100.
Whilst the Cash Sales in column C for the same product in row 3 are 50.
Has anyone done this before? Any thoughts would be greatly appreciated! TIA
[TABLE="width: 470"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]Product ID[/TD]
[TD]Product Name[/TD]
[TD]Cash Sales[/TD]
[TD]Group ID[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]Nice Marmalade 70g[/TD]
[TD]100[/TD]
[TD]1234[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]Nice Marmalade 70g[/TD]
[TD]50[/TD]
[TD]1234[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Nice Jam 70g[/TD]
[TD]0[/TD]
[TD]1234[/TD]
[/TR]
[TR]
[TD]5678[/TD]
[TD]Cool Strawberry Juice 50ml[/TD]
[TD]200[/TD]
[TD]5678[/TD]
[/TR]
[TR]
[TD]5678[/TD]
[TD]Cool Strawberry Juice 50ml[/TD]
[TD]100[/TD]
[TD]5678[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Cool Orange Juice 50ml[/TD]
[TD]0[/TD]
[TD]5678[/TD]
[/TR]
[TR]
[TD]2345[/TD]
[TD]Great Raspberry 70ml[/TD]
[TD]500[/TD]
[TD]2345[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Great Grapefruit 70ml[/TD]
[TD]0[/TD]
[TD]2345[/TD]
[/TR]
[TR]
[TD]2345[/TD]
[TD]Great Raspberry 70ml[/TD]
[TD]500[/TD]
[TD]2345[/TD]
[/TR]
</tbody>[/TABLE]