Help with returning adjacent text cell for the maximum occurrence within groups of IDs
Data:
[TABLE="width: 605"]
<tbody>[TR]
[TD]ID (A)
[/TD]
[TD]CODE (B)
[/TD]
[TD]SKU Count (C)
[/TD]
[TD]Code Occurrence (D)
[/TD]
[TD]Code % Of Occurrence
(E)
[/TD]
[TD]Max Occurrence % (H)
[/TD]
[TD]Results Needed
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]A
[/TD]
[TD]6
[/TD]
[TD]4
[/TD]
[TD]0.67
[/TD]
[TD]0.67
[/TD]
[TD]A
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]B
[/TD]
[TD]6
[/TD]
[TD]2
[/TD]
[TD]0.33
[/TD]
[TD]0.67
[/TD]
[TD]A
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]A
[/TD]
[TD]6
[/TD]
[TD]4
[/TD]
[TD]0.67
[/TD]
[TD]0.67
[/TD]
[TD]A
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]A
[/TD]
[TD]6
[/TD]
[TD]4
[/TD]
[TD]0.67
[/TD]
[TD]0.67
[/TD]
[TD]A
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]A
[/TD]
[TD]6
[/TD]
[TD]4
[/TD]
[TD]0.67
[/TD]
[TD]0.67
[/TD]
[TD]A
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]B
[/TD]
[TD]6
[/TD]
[TD]2
[/TD]
[TD]0.33
[/TD]
[TD]0.67
[/TD]
[TD]A
[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]A
[/TD]
[TD]5
[/TD]
[TD]1
[/TD]
[TD]0.20
[/TD]
[TD]0.40
[/TD]
[TD]B
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]B
[/TD]
[TD]5
[/TD]
[TD]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