Quote:
Originally Posted by Shasur
Hi
Try to do a SumIf. I think that should solve the problem.
Cheers
Shasur
|
Thanks Shasur, but Sumif wouldn't work - there would be too many unique items in the list to create a Sumif for each one (could easily number in the scores, if not hundreds of unique items).
It needs to be done programmatically.
I initially tried a "brute force" algorithm where I started with the first item in the list, copied it to my condensed list, then looping through each successive item in the un-condensed list, I'd search the condensed list to see if that item existed there yet and if so, would simply add the quantity to that quantity. And if it didn't exist, I'd add it to the condensed list then move to the next item in my uncondensed list - again, looping through each item in that list.
In theory, that algorithm should work fine; and it's possible my first attempts at it floundered merely because I'd coded it incorrectly. Getting it working wasn't a priority when I first attempted it (having a plethora of more important tasks to complete); but now risen to the fore and I'd like to attack it again - only I'm still busy and mentally just can't seem to wrap my brain around it, kwim? :) :) :)