Quote:
|
Originally Posted by tasha123
Hi Pls help. I am trying to write a sum function which compares values down a column and then adds values from another column if there are more than one. The formula I wrote works for 2 identical values but not for more than that. I'll copy my formula to make it clearer:
=IF(A2=A3, A2+A3, "").
This works if A2 and A3 are duplicated but does not work if there are more than 2. How can I get round this? Does anyone know how I can write it in VBA if it can't be done as a pure function?
|
is it something like this you are after (this is just a guess at what is required)
=SUMPRODUCT(--($A$2:$A$13=$A2)*($B$2:$B$13))
give it a try and see if it does what you need if not as fazza sed youll need to be clearer
All the Best
Dave