# Thread: Sum of unique values in a column based on values in another column

1. ## Sum of unique values in a column based on values in another column

Hello,
Please find an example of my data attached.

I have a list of customers in column A and # of units sold to them in column B. I need to come up with a formula that will sum up values in column B based on 'unique' values in column A. So, e.g. when it comes to summing up # of units sold to customer 100620, I only want to sum up 19 in the final total and not 38 as you can see in column B as the # of units sold to a customer 100620.

Very much appreciate your help in advance.
Thanks!

2. You might be able to accomplish this by using the SUMIF function.

3. Originally Posted by pandyav
Very much appreciate your help in advance.
You can extract the unique in column D.
If D2 condition then try formula
Code:
```=SUMIF(\$A\$2:\$B\$5;D2;\$B\$2:\$B\$5)
or
=SUMPRODUCT((\$B\$2:\$B\$5)*(\$A\$2:\$A\$5=D2))```
btw: see Unique vs Distinct

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•