help with formula ( count and suim f)

Imran Azam

Board Regular
Joined
Mar 15, 2011
Messages
103
hi guys

a i am trying to count the number of customers that have both product AR and SR
and what is the combined QTY

so for example

i want something like this

Product combo combined qty number of customer
AR&SR 67 2

below is the data how can i do this ? i cant get the sumif and count if correct

[TABLE="width: 380"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]product[/TD]
[TD]QTY[/TD]
[TD]customer[/TD]
[/TR]
[TR]
[TD]AR[/TD]
[TD]5[/TD]
[TD]ALEX[/TD]
[/TR]
[TR]
[TD]AR[/TD]
[TD]8[/TD]
[TD]JAMES[/TD]
[/TR]
[TR]
[TD]AR[/TD]
[TD]2[/TD]
[TD]RYAN[/TD]
[/TR]
[TR]
[TD]AR[/TD]
[TD]6[/TD]
[TD]aa[/TD]
[/TR]
[TR]
[TD]AR[/TD]
[TD]9[/TD]
[TD]bb[/TD]
[/TR]
[TR]
[TD]AR[/TD]
[TD]1[/TD]
[TD]dd[/TD]
[/TR]
[TR]
[TD]AR[/TD]
[TD]1[/TD]
[TD]ee[/TD]
[/TR]
[TR]
[TD]AR[/TD]
[TD]1[/TD]
[TD]ff[/TD]
[/TR]
[TR]
[TD]AR[/TD]
[TD]1[/TD]
[TD]gg[/TD]
[/TR]
[TR]
[TD]SR[/TD]
[TD]20[/TD]
[TD]ALEX[/TD]
[/TR]
[TR]
[TD]SR[/TD]
[TD]1[/TD]
[TD]kk[/TD]
[/TR]
[TR]
[TD]SR[/TD]
[TD]1[/TD]
[TD]pp[/TD]
[/TR]
[TR]
[TD]SR[/TD]
[TD]1[/TD]
[TD]UU[/TD]
[/TR]
[TR]
[TD]SR[/TD]
[TD]40[/TD]
[TD]RYAN[/TD]
[/TR]
[TR]
[TD]SR[/TD]
[TD]3[/TD]
[TD]ZZ
[/TD]
[/TR]
</tbody>[/TABLE]

thanks for any helo
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Product combo combined qty number of customer
AR&SR 67 2

How 67 comes ? and 2 ?

-----

If you make a sum of AR & SR then Total = 100
 
Last edited:
Upvote 0
Assuming you have the product in alphabetical order I.e. AR ALWAYS comes before SR, and that a customer is only listed once per product then try this:
Add 2 helper columns; (Assuming your data is in A2:C16) then:

Set D2 =SUMPRODUCT(--($C$2:$C$16=C2)) and drag formula down to D16

Set E2 =IFNA(IF(D2=1,"",B2+INDEX(A3:$D$16,MATCH(C2,C3:$C$16,FALSE),2)),"") and drag formula down to E16

Then in cell F2 add the formula for final answer:
=CONCAT("AR&SR ",SUM(E2:E16)," ",COUNT(E2:E16))

In this example I have F2 = "AR&SR 67 2" which is what you have put in your initial post.

EDIT: Changed F2 formula to make more sense than before.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,310
Members
452,634
Latest member
cpostell

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