Count Number of Rows With Matching Product

who am i

New Member
Joined
Oct 28, 2024
Messages
15
Office Version
  1. 2019
Hello!

How can I count essentially the number of rows with a particular value? In column A is the order number and in columns B:E are products in the order. The issue is that a customer may order the same product twice in the same order, but that need only be counted once.

On a separate sheet (same one here for visibility) will be a list of all applicable products. I need a formula showing the number of orders each product is present in. I filled in the formula column with expected values.

Book1
ABCDEFGHIJKL
1OrderProduct 1Product 2Product 3Product 4ProductsNumber of Orders
21CrowCrowEagleSparrowCrow1
32DonglePuckDongle2
43DonglePuck1
54Crow BlowEagle1
65BlowSparrow1
7Crow Blow1
8Blow 1
Sheet1
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
How about
Excel Formula:
=SUM(SIGN(MMULT(--($B$2:$E$10=K2),TRANSPOSE(COLUMN($B$2:$E$2)^0))))
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0
how would I add additional criteria to this count? Like if there was a date column in the orders, and I wanted just the sum of orders between 2 dates?
 
Upvote 0
Can you post some sample data.
 
Upvote 0
absolutely and let me know if you want me to start a new post so that another solution may be awarded.


Book1
ABCDEFGHIJKLMNOP
1OrderProduct 1Product 2Product 3Product 4Order DateProductsCountCount
21RedRedYellow1/5/2025Red10
32BlueBlue1/2/2025Blue10
43Green12/30/2024Green01
54Yellow12/27/2024Yellow11
6
7
8
9
10
11Beginning Date1/1/20251/1/2024
12End Date12/31/202512/31/2024
Sheet1
Cell Formulas
RangeFormula
O12:P12O12=EOMONTH(O11,11)
 
Upvote 0
Thanks for that.
How about
Fluff.xlsm
ABCDEFGNOP
1OrderProduct 1Product 2Product 3Product 4Order DateProductsCountCount
21RedRedYellow05/01/2025Red10
32BlueBlue02/01/2025Blue10
43Green30/12/2024Green01
54Yellow27/12/2024Yellow11
6
7
8
9
10
11Beginning Date01/01/202501/01/2024
12End Date31/12/202531/12/2024
Sheet6
Cell Formulas
RangeFormula
O2:P5O2=SUM(SIGN(MMULT(($B$2:$E$10=$N2)*($F$2:$F$10>=O$11)*($F$2:$F$10<=O$12),TRANSPOSE(COLUMN($B$2:$E$2)^0))))
O12:P12O12=EOMONTH(O11,11)
 
Upvote 0

Forum statistics

Threads
1,225,738
Messages
6,186,725
Members
453,368
Latest member
positivemind

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