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

productQTYcustomer
AR5ALEX
AR8JAMES
AR2RYAN
AR6aa
AR9bb
AR1dd
AR1ee
AR1ff
AR1gg
SR20ALEX
SR1kk
SR1pp
SR1UU
SR40RYAN
SR3ZZ

<colgroup><col><col><col></colgroup><tbody>
</tbody>

thanks for any helo
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
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,215,220
Messages
6,123,693
Members
449,117
Latest member
Aaagu

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