Count Single and Multiple Number

ibmy

Board Regular
Joined
Mar 4, 2020
Messages
138
Office Version
  1. 2016
Platform
  1. Windows
Hi,

4.5.xlsb
BCDEFG
1DataSingle, =1Multiple, >1
21.189811.1898152
31.189751.1897520
41.189811.1895521
51.189551.1105110
61.18981
71.18981
81.18981
91.18981
101.18981
111.11051
121.18981
131.18955
141.18981
151.18975
161.18981
171.18981
181.18955
191.18955
201.18981
templete 1

Example :
E2 is 1.18981
then, Count Single in Column B which is appear in B2, B4, B12, B14, B20....result in F2
then, Count Multiple in Column B which is appear in B6-B10, B16-B17.....result in G2

p/s: Real data in Column B ranging from 50k-70k rows, and Column E (distinct value from Column B) ranging from 200-400 rows.
 
Try with formula first for your sample size (with larger data, if excel hang out, if you refer to a VBA solution, I will come back)

Book1
BCDEFG
1DataSingle, =1Multiple, >1
21.189811.1898152
31.189751.1897520
41.189811.1895521
51.189551.1105110
61.18981
71.18981
81.18981
91.18981
101.18981
111.11051
121.18981
131.18955
141.18981
151.18975
161.18981
171.18981
181.18955
191.18955
201.18981
Sheet1
Cell Formulas
RangeFormula
F2:F5F2=SUMPRODUCT(--($B$2:$B$20=$E2), --($B$1:$B$19<>$E2), --($B$3:$B$21<>$E2))
G2:G5G2=SUMPRODUCT(--($B$2:$B$20=$E2), --($B$1:$B$19<>$E2), --($B$3:$B$21=$E2))
 
Upvote 1
@bebo021999 thanks for solution.

The formula work acceptable fast for small data.
I think I need VBA solution for larger data.
 
Upvote 0

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