Count if formula

Pardeepd

New Member
Joined
Nov 12, 2018
Messages
3
Hello,

I need a formula to show the total number items sold each month by department then also count the total items sold by employee in that department.

Please could you let me know what formula to use?
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi,

sumproduct & sumif or countif will help can you post some sample data?
 
Upvote 0
I need a formula to show the total products sold per week, I then need a formula to count against each product the quantity sold.
This is the data I have.
[TABLE="width: 244"]
<tbody>[TR]
[TD]Week
[/TD]
[TD]Product
[/TD]
[TD]Total
[/TD]
[/TR]
[TR]
[TD]03/08/2018
[/TD]
[TD]Mobile phone
[/TD]
[TD]5
[/TD]
[/TR]
[TR]
[TD]03/08/2018
[/TD]
[TD]Laptop
[/TD]
[TD]4
[/TD]
[/TR]
[TR]
[TD]03/08/2018
[/TD]
[TD]TV
[/TD]
[TD]7
[/TD]
[/TR]
[TR]
[TD]03/08/2018
[/TD]
[TD]DVD Player
[/TD]
[TD]5
[/TD]
[/TR]
[TR]
[TD]03/08/2018
[/TD]
[TD]Laptop
[/TD]
[TD]7
[/TD]
[/TR]
[TR]
[TD]10/08/2018
[/TD]
[TD]Laptop
[/TD]
[TD]5
[/TD]
[/TR]
[TR]
[TD]10/08/2018
[/TD]
[TD]Mobile Phone
[/TD]
[TD]3
[/TD]
[/TR]
[TR]
[TD]10/08/2018
[/TD]
[TD]TV
[/TD]
[TD]15
[/TD]
[/TR]
[TR]
[TD]10/08/2018
[/TD]
[TD]Laptop
[/TD]
[TD]4
[/TD]
[/TR]
</tbody>[/TABLE]

I would like it to show as below:
[TABLE="width: 373"]
<tbody>[TR]
[TD]Items sold
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Week
[/TD]
[TD]Mobile phone
[/TD]
[TD]Laptop
[/TD]
[TD]TV
[/TD]
[TD]DVD Player
[/TD]
[/TR]
[TR]
[TD]04/08/2018
[/TD]
[TD] 1
[/TD]
[TD]2
[/TD]
[TD]1
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]10/08/2018
[/TD]
[TD] 1
[/TD]
[TD]2
[/TD]
[TD]1
[/TD]
[TD]0
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"]Total items sold per week
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Week
[/TD]
[TD]Mobile phone
[/TD]
[TD]Laptop
[/TD]
[TD]TV
[/TD]
[TD]DVD Player
[/TD]
[/TR]
[TR]
[TD]04/08/2018
[/TD]
[TD] 5
[/TD]
[TD]11
[/TD]
[TD]7
[/TD]
[TD]5
[/TD]
[/TR]
[TR]
[TD]10/08/2018
[/TD]
[TD] 3
[/TD]
[TD]9
[/TD]
[TD]15
[/TD]
[TD]0
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Hi Par,

Copy these into your tables;


Book1
ABCDE
1WeekProductTotal
203-08-18Mobile phone5
303-08-18Laptop4
403-08-18TV7
503-08-18DVD Player5
603-08-18Laptop7
710-08-18Laptop5
810-08-18Mobile Phone3
910-08-18TV15
1010-08-18Laptop4
11
12Items sold
13WeekMobile phoneLaptopTVDVD Player
1403-08-181211
1510-08-181210
16
17Total items sold per week
18WeekMobile phoneLaptopTVDVD Player
1904-08-1851175
2010-08-1839150
Sheet1
Cell Formulas
RangeFormula
B14=COUNTIFS($B$2:$B$10,B$13,$A$2:$A$10,">="&$A14-5,$A$2:$A$10,"<="&$A14)
B19=SUMIFS($C$2:$C$10,$A$2:$A$10,">="&$A19-5,$A$2:$A$10,"<="&$A19,$B$2:$B$10,B$18)
 
Last edited:
Upvote 0
Sorry I may not have explained this properly.

What I need is a formula to count the items selected/bought in week ending 3/8/2018 etc. In this case, this would be Mobile phone 1, laptop – 2, tv – 1 and DVD player – 1 and the same for week ending 10/8/2018.

Once I have these results I then need to know the quantity of items sold against each product in w/e 3/8/2018 and 10/8/018. I.e.

3/8/2018 - Mobile Phone (5 sold), laptop (11 sold), tv (7 sold) and dvd player (5 sold)
10/8/2018 - Mobile Phone (3 sold), laptop (9 sold), tv (15 sold) and dvd player (0 sold)

Could you help me with the formula to show the above as I then need to create a graph (clustered/stacked)
 
Upvote 0
RasGhul's formulae work for me, in what way are they not working for you?
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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