count number of voucher per day

yky

Well-known Member
Joined
Jun 7, 2011
Messages
1,881
Office Version
  1. 2010
Platform
  1. Windows
I have sales data which I need to count the number of voucher for each day. Is there a formula to do so?

Desired outcome: 4-5-0-3-2 for the five days.

[TABLE="width: 150"]
<tbody>[TR]
[TD]DATE[/TD]
[TD] VOUCHER NO.[/TD]
[/TR]
[TR]
[TD]1-Oct-16[/TD]
[TD]091[/TD]
[/TR]
[TR]
[TD]1-Oct-16[/TD]
[TD]092[/TD]
[/TR]
[TR]
[TD]1-Oct-16[/TD]
[TD]093[/TD]
[/TR]
[TR]
[TD]1-Oct-16[/TD]
[TD]094[/TD]
[/TR]
[TR]
[TD]1-Oct-16[/TD]
[TD]094[/TD]
[/TR]
[TR]
[TD]2-Oct-16[/TD]
[TD]095[/TD]
[/TR]
[TR]
[TD]2-Oct-16[/TD]
[TD]095[/TD]
[/TR]
[TR]
[TD]2-Oct-16[/TD]
[TD]096[/TD]
[/TR]
[TR]
[TD]2-Oct-16[/TD]
[TD]096[/TD]
[/TR]
[TR]
[TD]2-Oct-16[/TD]
[TD]097[/TD]
[/TR]
[TR]
[TD]2-Oct-16[/TD]
[TD]097[/TD]
[/TR]
[TR]
[TD]2-Oct-16[/TD]
[TD]098[/TD]
[/TR]
[TR]
[TD]2-Oct-16[/TD]
[TD]099[/TD]
[/TR]
[TR]
[TD]3-Oct-16[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4-Oct-16[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]4-Oct-16[/TD]
[TD]001[/TD]
[/TR]
[TR]
[TD]4-Oct-16[/TD]
[TD]002[/TD]
[/TR]
[TR]
[TD]4-Oct-16[/TD]
[TD]002[/TD]
[/TR]
[TR]
[TD]5-Oct-16[/TD]
[TD]003[/TD]
[/TR]
[TR]
[TD]5-Oct-16[/TD]
[TD]003[/TD]
[/TR]
[TR]
[TD]5-Oct-16[/TD]
[TD]003[/TD]
[/TR]
[TR]
[TD]5-Oct-16[/TD]
[TD]003[/TD]
[/TR]
[TR]
[TD]5-Oct-16[/TD]
[TD]004[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I have sales data which I need to count the number of voucher for each day. Is there a formula to do so?

Desired outcome: 4-5-0-3-2 for the five days.

[TABLE="width: 150"]
<tbody>[TR]
[TD]DATE[/TD]
[TD] VOUCHER NO.[/TD]
[/TR]
[TR]
[TD]1-Oct-16[/TD]
[TD]091[/TD]
[/TR]
[TR]
[TD]1-Oct-16[/TD]
[TD]092[/TD]
[/TR]
[TR]
[TD]1-Oct-16[/TD]
[TD]093[/TD]
[/TR]
[TR]
[TD]1-Oct-16[/TD]
[TD]094[/TD]
[/TR]
[TR]
[TD]1-Oct-16[/TD]
[TD]094[/TD]
[/TR]
[TR]
[TD]2-Oct-16[/TD]
[TD]095[/TD]
[/TR]
[TR]
[TD]2-Oct-16[/TD]
[TD]095[/TD]
[/TR]
[TR]
[TD]2-Oct-16[/TD]
[TD]096[/TD]
[/TR]
[TR]
[TD]2-Oct-16[/TD]
[TD]096[/TD]
[/TR]
[TR]
[TD]2-Oct-16[/TD]
[TD]097[/TD]
[/TR]
[TR]
[TD]2-Oct-16[/TD]
[TD]097[/TD]
[/TR]
[TR]
[TD]2-Oct-16[/TD]
[TD]098[/TD]
[/TR]
[TR]
[TD]2-Oct-16[/TD]
[TD]099[/TD]
[/TR]
[TR]
[TD]3-Oct-16[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4-Oct-16[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]4-Oct-16[/TD]
[TD]001[/TD]
[/TR]
[TR]
[TD]4-Oct-16[/TD]
[TD]002[/TD]
[/TR]
[TR]
[TD]4-Oct-16[/TD]
[TD]002[/TD]
[/TR]
[TR]
[TD]5-Oct-16[/TD]
[TD]003[/TD]
[/TR]
[TR]
[TD]5-Oct-16[/TD]
[TD]003[/TD]
[/TR]
[TR]
[TD]5-Oct-16[/TD]
[TD]003[/TD]
[/TR]
[TR]
[TD]5-Oct-16[/TD]
[TD]003[/TD]
[/TR]
[TR]
[TD]5-Oct-16[/TD]
[TD]004[/TD]
[/TR]
</tbody>[/TABLE]

=IFERROR(SUM(IF($A$2:$A$24=$F2, 1/(COUNTIFS($A$2:$A$24, $F2, $B$2:$B$24, $B$2:$B$24)), 0)),0) press CTRL+SHIFT+ENTER
 
  • Like
Reactions: yky
Upvote 0
[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]
A
[/TD]
[TD]
B
[/TD]
[TD]
C
[/TD]
[TD]
D
[/TD]
[TD]
E
[/TD]
[TD]
F
[/TD]
[TD]
G
[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD]
1-Oct-16​
[/TD]
[TD]
91​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
1-Oct-16​
[/TD]
[TD][/TD]
[TD]
4​
[/TD]
[/TR]
[TR]
[TD]
2
[/TD]
[TD]
1-Oct-16​
[/TD]
[TD]
92​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
2-Oct-16​
[/TD]
[TD][/TD]
[TD]
5​
[/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD]
1-Oct-16​
[/TD]
[TD]
93​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
3-Oct-16​
[/TD]
[TD][/TD]
[TD]
0​
[/TD]
[/TR]
[TR]
[TD]
4
[/TD]
[TD]
1-Oct-16​
[/TD]
[TD]
94​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
4-Oct-16​
[/TD]
[TD][/TD]
[TD]
3​
[/TD]
[/TR]
[TR]
[TD]
5
[/TD]
[TD]
1-Oct-16​
[/TD]
[TD]
94​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
5-Oct-16​
[/TD]
[TD][/TD]
[TD]
2​
[/TD]
[/TR]
[TR]
[TD]
6
[/TD]
[TD]
2-Oct-16​
[/TD]
[TD]
95​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
7
[/TD]
[TD]
2-Oct-16​
[/TD]
[TD]
95​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
8
[/TD]
[TD]
2-Oct-16​
[/TD]
[TD]
96​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
9
[/TD]
[TD]
2-Oct-16​
[/TD]
[TD]
96​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
10
[/TD]
[TD]
2-Oct-16​
[/TD]
[TD]
97​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
11
[/TD]
[TD]
2-Oct-16​
[/TD]
[TD]
97​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
12
[/TD]
[TD]
2-Oct-16​
[/TD]
[TD]
98​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
13
[/TD]
[TD]
2-Oct-16​
[/TD]
[TD]
99​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
14
[/TD]
[TD]
3-Oct-16​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
15
[/TD]
[TD]
4-Oct-16​
[/TD]
[TD]
100​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
16
[/TD]
[TD]
4-Oct-16​
[/TD]
[TD]
1​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
17
[/TD]
[TD]
4-Oct-16​
[/TD]
[TD]
2​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
18
[/TD]
[TD]
4-Oct-16​
[/TD]
[TD]
2​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
19
[/TD]
[TD]
5-Oct-16​
[/TD]
[TD]
3​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
20
[/TD]
[TD]
5-Oct-16​
[/TD]
[TD]
3​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
21
[/TD]
[TD]
5-Oct-16​
[/TD]
[TD]
3​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
22
[/TD]
[TD]
5-Oct-16​
[/TD]
[TD]
3​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
23
[/TD]
[TD]
5-Oct-16​
[/TD]
[TD]
4​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


g1=SUM(IF(FREQUENCY(IF($A$1:$A$23=E1,IF($B$1:$B$23<>"",$B$1:$B$23)),$B$1:$B$23),1)) control +shift+enter copy down

After you type in the formula, don't just press enter.
Instead, press CTRL + SHIFT + ENTER


If you've already entered the formula, then highlight the cell with the formula and press F2.
Then press CTRL + SHIFT + ENTER



 
Last edited:
  • Like
Reactions: yky
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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