Sum values based on criteria in another column
Essentially, what I am looking to do is go through a sheet and say:
If value of C3 matches value of C2, then add J2+J3, and then delete row 3.
If i was familiar with excel, or knew how to script/program in excel, i would
think it would be something like this (basic idea...)
n == 3
DO While (n < Number_of_rows)
DO While (Cn == C2)
J2 == J2 + Jn
Delete Row 3
End Do
n == n+1
END DO
^^ That would be check to see if the contents of column C matched the
contents of C2, and if they did, would sum the J column values in J2. I
would then have more code to check to see if any of the values of column C
matched the new value in C3, and would combine all J column values into J3.
Then check C4 and sum into J4, C5 sum J's into J5... Etc. All the way
through C(number of rows) into J(number of rows)
It's been a while since I did any real programming, and the only language i
even know is fortran, so sorry if that code is hard to follow... Any help
would be very much appreciated!!!
|