Good day to all :-)

I have a sheet of Excel in which an item can have different numbers and quantity like following.

item_________number___________quantity

aaaa_________2________________50

aaaa_________2________________60

aaaa_________4________________30

aaaa_________5________________10

jjjj_________9________________5

jjjj_________8________________1

Similarly there are thousands of records in which an item has different numbers and quantity.

My task is:

1. take item

2. add quantities of same number of that item like aaaa has number 2 and 4 and the number two has different quantity. so I will sum 50 and 60 (110) for number 2 of item aaaa and quantity of number 4 is 30 and quantity of number 5 is 10. now 110 is greater than 30 and 10 so the actual number of item is 2.

Means we just sum the quantities of same number of an item and find the maximum sum and the number that has maximum sum of quantities is the actual number of that item.

Can I do that with any Excel formula or Function or is there any macro code for this that I can implement.

Thanks and Regards,

Anil