Sumproduct with Unique Instances

Chip_Excel

New Member
Joined
Jul 20, 2010
Messages
8
Hi Everyone,
I am having problems getting an accurate number of unique items in an array based on a criteria.

I have a range J2:J1788 and within that range are 95 unique instances (hand counted) based off of two criteria: X in column AE and Y in column G.

Here is my formula:

=SUMPRODUCT(IF(Sheet6!$AE$2:$AE$1788=X,1,0)*IF(Sheet6!$G$2:$G$1788=Y,1,0)*1/COUNTIF(Sheet6!$J$2:$J$1788,Sheet6!$J$2:$J$1788))

The formula returns: 70.6549784

My guess that it is parsing up the unique instances to decimals, i.e. if there are 4 instances of a unique value the formula counts it as .25 instead of 1.

Any ideas how I can get the formulas to count it as one? Can I place a ROUNDUP function in there somewhere?

Best,
Chip
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hello Chip,

I don't think that approach will work - Do you have excel 2007 or later, in which case try

=SUMPRODUCT((sheet6!$AE$2:$AE$1788="X")*(sheet6!$G$2:$G$1788="Y")/COUNTIFS(sheet6!$AE$2:$AE$1788,sheet6!$AE$2:$AE$1788&"",sheet6!$G$2:$G$1788,sheet6!$G$2:$G$1788&"",sheet6!$J$2:$J$1788,sheet6!$J$2:$J$1788&""))

I put "X" and "Y" in quotes I assume they aren't named ranges.....?
 
Upvote 0

Forum statistics

Threads
1,224,589
Messages
6,179,744
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top