Formula to count duplicate Values every x # of rows

inosent1

New Member
Joined
Jan 4, 2022
Messages
7
Office Version
  1. 2010
I have a column of data, 100 rows deep

Here are the first 15 rows

1
2
3
4
3
6
6
8
8
10
11
12
12
14
15

What I am looking for is a formula I can Ctrl-D that will check every 5 rows and count the number of duplicate values. The result would look like this

Rows 1-5: 1 (3 is duplicated)
Rows 2-6: 1 (3 is duplicated)
Rows 3-7: 2 (3 and 6 is duplicated)
Rows 4-8: 1 (6 is duplicated)

etc
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Is your profile up to date?…you’re using Excel 2010?
 
Upvote 0
From your initial example, you mention wanting the number of duplicate values (assuming you do not care how many times they are duplicated), but then in your description, you also show in parentheses which numbers are duplicated. Is the information in parentheses shown only to help others understand the answers shown?...or do you want the final results also to show the numbers that are duplicated.
 
Upvote 0
From your initial example, you mention wanting the number of duplicate values (assuming you do not care how many times they are duplicated), but then in your description, you also show in parentheses which numbers are duplicated. Is the information in parentheses shown only to help others understand the answers shown?...or do you want the final results also to show the numbers that are duplicated.
It's just for the sake of clarification for this post. I only need to know if the # of dups in the selected range is >0
 
Upvote 0
Try this. You'll need to confirm this as an array formula by entering it with Ctrl-Shift-Enter ...then pull the formula down the sheet.
Book1
AB
111
221
332
432
532
662
761
882
981
10102
11122
1212
1314
1414
1515
Sheet1
Cell Formulas
RangeFormula
B1:B11B1=SUMPRODUCT(--(FREQUENCY(OFFSET(A1,,,5),OFFSET(A1,,,5))>1))
 
Upvote 0
Try this. You'll need to confirm this as an array formula by entering it with Ctrl-Shift-Enter ...then pull the formula down the sheet.
Book1
AB
111
221
332
432
532
662
761
882
981
10102
11122
1212
1314
1414
1515
Sheet1
Cell Formulas
RangeFormula
B1:B11B1=SUMPRODUCT(--(FREQUENCY(OFFSET(A1,,,5),OFFSET(A1,,,5))>1))

Checking against the data, thanks!
 
Upvote 0
And if you want the text before each answer, and to accommodate data beginning on some row other than 1:
Cell Formulas
RangeFormula
B2:B12B2="Rows "&ROW(A2)-ROW(A$2)+1&"-"&ROW(A2)-ROW(A$2)+6&": "&SUMPRODUCT(--(FREQUENCY(OFFSET(A2,,,5),OFFSET(A2,,,5))>1))


And if you'd prefer to avoid a volatile function like OFFSET, you could replace those functions with:
Excel Formula:
A2:INDEX(A:A,ROW(A2)+4)
 
Last edited:
Upvote 0
A non volatile version of KRice's formula
Fluff.xlsm
AB
1
211
321
432
541
632
762
861
981
1081
11101
12111
13121
14120
15140
1615
Sheet4
Cell Formulas
RangeFormula
B2:B15B2=SUMPRODUCT(--(FREQUENCY(A2:A6,A2:A6)>1))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,958
Members
449,096
Latest member
Anshu121

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