Addition of the int values based on condition

Solved/Closed
Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
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 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768