Count various duplicate ranges

motilulla

Well-known Member
Joined
Feb 13, 2008
Messages
2,422
Office Version
  1. 2010
Hello,

I want to count various duplicate ranges in the separate columns, I got numbers in the columns C:G In the range C6 to G down and in the column "I" there is a text "End" it mean End of the row for first range for count of duplicates...and then new count start till next End...and so on continue....

In the column K there are unique numbers 1 to 25 which I want to use for duplicate counts.

For example--1st range will be C6:G12 count of duplicate result I want in L6 to down, for now in this example I have used Formula "=COUNTIF($C$6:$G$12,$K6)" copied down to L30

For example--2nd range will be C13:G18 count of duplicate result I want in M6 to down, for now in this example I have used Formula "=COUNTIF($C$13:$G$18,$K6)" copied down to L30

As I got long data list I need a VBA please help

*ABCDEFGHIJKLMNOPQR
1
2
3CountCountCountCountCount
4DuplicateDuplicateDuplicateDuplicateDuplicate
5n1n2n3n4n5StatusUniquesTill EndEndEndEnd?
62434354246110111
72027344650200110
81117214850301110
9116384245402020
101117183944500010
111315303542611001
12615223744End702123
13310232744800103
1467383944900100
154193441431001020
167252748491120010
1720232630331200000
18416213642End1310021
199161819211400100
2014172829391520000
21272227401611220
2231323840421720101
23131624371810210
24818253546End1901111
25272443462011001
2610192345492111100
274161825442210101
2814710502302010
2911162438402410122
3013364043502501111
3135344049
321327284243End
33132354548
3478242736
35620242550
3678192829
37717222740
38813263438
392728293443
40
41
42

Thank you all.

I am using Excel 2000

Regards,
Moti
 

Attachments

  • Count Duplicates.png
    Count Duplicates.png
    53 KB · Views: 10

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Try something like this...
Helper cells in Blue
Insert End in I39

Pasta1
CDEFGHIJKLMNOP
1Start18142028
2End713192734
3CountCountCountCountCount
4DuplicateDuplicateDuplicateDuplicateDuplicate
5n1n2n3n4n5StatusUniquesTill EndEndEndEnd?
62434354246110111
72027344650200110
81117214850301110
9116384245402020
101117183944500010
111315303542611001
12615223744End702123
13310232744800103
1467383944900100
154193441431001020
167252748491120010
1720232630331200000
18416213642End1310021
199161819211400100
2014172829391520000
21272227401611220
2231323840421720101
23131624371810210
24818253546End1901111
25272443462011001
2610192345492111100
274161825442210101
2814710502302010
2911162438402410122
3013364043502501111
3135344049
321327284243End
33132354548
3478242736
35620242550
3678192829
37717222740
38813263438
392728293443End
Plan2
Cell Formulas
RangeFormula
L1:P1L1=N(K2)+1
L2:P2L2=MATCH($K2,INDEX($I$6:$I$39,L$1):$I$39,0)+L1-1
L6:P30L6=COUNTIF(INDEX($C$6:$C$39,L$1):INDEX($G$6:$G$39,L$2),$K6)


M.
 
Upvote 0
Solution
Try something like this...
Helper cells in Blue
Insert End in I39

Pasta1
CDEFGHIJKLMNOP
1Start18142028
2End713192734
3CountCountCountCountCount
4DuplicateDuplicateDuplicateDuplicateDuplicate
5n1n2n3n4n5StatusUniquesTill EndEndEndEnd?
62434354246110111
72027344650200110
81117214850301110
9116384245402020
101117183944500010
111315303542611001
12615223744End702123
13310232744800103
1467383944900100
154193441431001020
167252748491120010
1720232630331200000
18416213642End1310021
199161819211400100
2014172829391520000
21272227401611220
2231323840421720101
23131624371810210
24818253546End1901111
25272443462011001
2610192345492111100
274161825442210101
2814710502302010
2911162438402410122
3013364043502501111
3135344049
321327284243End
33132354548
3478242736
35620242550
3678192829
37717222740
38813263438
392728293443End
Plan2
Cell Formulas
RangeFormula
L1:P1L1=N(K2)+1
L2:P2L2=MATCH($K2,INDEX($I$6:$I$39,L$1):$I$39,0)+L1-1
L6:P30L6=COUNTIF(INDEX($C$6:$C$39,L$1):INDEX($G$6:$G$39,L$2),$K6)


M.
Marcelo Branco, after adapting your formulas with my original worksheet with large data when I obtain all the result so accurate really I get amazed for me it has a magical formula solution. ?

And has worked for me more better than my expectations best part is a just adding a "End" text any where in the column "I" it recalculate fast and with accuracy

I am so happy by your work. Thank you so much for your help and time you took to giving a best solution

Good Luck! Have a good day

Kind Regards,
Moti :)
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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