• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Sum unique values as per price index

H.V.K

New Member
Hi all,

The attached file shows 3 data ranges: price index, revenue and brand. I am unable to work out a working formula to sum unique brands as per price index

To demonstrate, it will look like this when a working formula is in place

upload_2016-3-12_23-13-29.png

Please kindly advise,

Much appreciated,

Leo,
 

Attachments

  • Sum unique values.xlsx
    36.5 KB · Views: 7
Is the spreadsheet segment above correct? i.e. There are 14 brands with a price index of less than 150,000 totaling 44,091,108?
 
What version of Excel are you using? Excel 2013 can count unique items in a Pivot Table using the Distinct Count feature ...

BTW, you have blanks in your brand column - I used the filter to exclude them to arrive at your answer of 14 for "<150,000"
 
Count unique brands as per price index :

=SUMPRODUCT((A$2:A$1311=$E2)*(C$2:C$1311<>"")*(MATCH(A$2:A$1311&C$2:C$1311,A$2:A$1311&C$2:C$1311,0)=ROW($1:$1310)))

Regards
Bosco
 
What version of Excel are you using? Excel 2013 can count unique items in a Pivot Table using the Distinct Count feature ...

BTW, you have blanks in your brand column - I used the filter to exclude them to arrive at your answer of 14 for "<150,000"
Try again
 

Attachments

  • Sum unique values - DME.xlsx
    129.3 KB · Views: 5
Thanks all for your reply

@David Evans : thanks for showing a new feature of pivot table. However, the nature of my work requires as less of pivot as possible

@bosco_yip : your formula works perfectly on a simplified data table. I copied to the original file (attached below) and it didn't work. Could you please have a look into it? Thanks a lot

Much appreciated,

Leo,
 

Attachments

  • Pricing Analysis.xlsx
    159.6 KB · Views: 6
@bosco_yip : your formula works perfectly on a simplified data table. I copied to the original file (attached below) and it didn't work. Could you please have a look into it? Thanks a lot
Leo,

Try,

1] Your data range E$2:E$1311, but the row should be --> Row(1:1310)

So……

2] In cell E23, formula copy down :

=SUMPRODUCT((Revenue_by_product_201602011732!Q$2:Q$1311=$B23)*(Revenue_by_product_201602011732!E$2:E$1311<>"")*(MATCH(Revenue_by_product_201602011732!Q$2:Q$1311&Revenue_by_product_201602011732!E$2:E$1311,Revenue_by_product_201602011732!Q$2:Q$1311&Revenue_by_product_201602011732!E$2:E$1311,0)=ROW($1:$1310)))

Regards
Bosco
 
Back
Top