Addition of the int values based on condition

Solved/Closed
Sumit - May 18, 2010 at 10:25 PM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - May 19, 2010 at 04:59 AM
Hello,



I am trying to sort out a problem in excel file. I have some duplicate strings in column C and there are some integer values in column D. I want to to add up the adjacent integer values in column D for the duplicate strings in column C.

Now the column A should be searched for that particular duplicated string in Column C and the result of the sum of the integer values should be displayed in the column B adjacent to the same string in Column A.

If a string is not duplicated in column C then the adjacent integer value should be displayed in the column B adjacent to the same string in column A.

A B C D
hello sss 1
sss hello 3
cc cc 4
hello 5
sss 2

The output shud be

A B C D
hello 8 sss 1
sss 3 hello 3
cc 4 cc 4
hello 5
sss 2


Please give the correct VB code accordding to the question. It ll be very helpful.

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
May 19, 2010 at 04:59 AM
0