Adding of the int values based on condition

Solved/Closed
Report
-
 Sumit -
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. The code that you posted was not the solution to the Question.

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
which solution are you reffing to? Could you post the link to that solution
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
Sumit you dont have to start a new question of the solution is not working as per expectation. If you have doubts or solution does not fit your need, if you can add on to that thread, it is easier to follow the history. Having said that the solution that was suggested earlier was to give you an idea how you could tackle. if ran on column C and D, it would have given you column A and B. There are many ways to resolve a issue.

see your your question and see if that helps
https://ccm.net/forum/affich-350777-add-up-the-values-of-duplicate-cells
i am very thankful to you for guiding me. I am satified with the VB code that u have given to me.
Thanks alot.