Formula to Count Repeat Value

ststern45

Well-known Member
Joined
Sep 17, 2005
Messages
965
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
RepeatValuesOnce.xlsm
R
12
Sheet2
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Please delete this post.
Having issues trying to upload Excel range XL2BB
Sorry for the trouble.
 
Upvote 0
Book2
ABCDEFGHIJKLMNOPQ
12814252888910142222
2891014221461213222314
36121322232271417219
42714172123516278
52351627Total 49131624Total
64913162433568264
7
8Count Repeat Values Only OnceCount Repeat Values Only Once
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K3:N6Expression=COUNTIF($K$1:$O$1,K3)textNO
J3:J6Expression=COUNTIF($K$1:$O$1,J3)textNO
K2:N2Expression=COUNTIF($K$1:$O$1,K2)textNO
J2Expression=COUNTIF($K$1:$O$1,J2)textNO
B3:E6Expression=COUNTIF($B$1:$F$1,B3)textNO
A3:A6Expression=COUNTIF($B$1:$F$1,A3)textNO
B2:E2Expression=COUNTIF($B$1:$F$1,B2)textNO
A2Expression=COUNTIF($B$1:$F$1,A2)textNO
 
Upvote 0
Please delete this post.
Having issues trying to upload Excel range XL2BB
Sorry for the trouble.
Book2
ABCDEFGHIJKLMNOPQ
12814252888910142222
2891014221461213222314
36121322232271417219
42714172123516278
52351627Total 49131624Total
64913162433568264
7
8Count Repeat Values Only OnceCount Repeat Values Only Once
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K3:N6Expression=COUNTIF($J$1:$N$1,K3)textNO
J3:J6Expression=COUNTIF($J$1:$N$1,J3)textNO
K2:N2Expression=COUNTIF($J$1:$N$1,K2)textNO
A3:A6Expression=COUNTIF($A$1:$E$1,A3)textNO
B2:E6Expression=COUNTIF($A$1:$E$1,B2)textNO
J2Expression=COUNTIF($J$1:$N$1,J2)textNO
A2Expression=COUNTIF($A$1:$E$1,A2)textNO
Cell Range A1 through E1 contains the values 2, 8, 14, 25, 28
I've tried a number of formulas and I'm stuck.
I'm trying to count how many values from cell range A2 through E6 are also in cell range A1 through E1.
The result should be 3
8, 14, 2 (14 & 2 are repeats and not counted more than once)
Counting values only once

Example #2
Cell range J1 through N1 contain the values are 8, 9, 10, 14, 22
Cell range J2 through N6 contain 4 values that also appear in cell range J1:N1
There are no repeat values so the result would be 4
22, 14, 9, 8

Thank you in advance
 
Upvote 0
Does this do what you want?

23 07 03.xlsm
ABCDEFGHIJKLMNOP
12814252889101422
289101422612132223
361213222327141721
4271417212351627
52351627Total 49131624Total
64913162433568264
Count
Cell Formulas
RangeFormula
G6,P6G6=SUM(--(COUNTIF(A2:E6,A1:E1)>0))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Solution
Does this do what you want?

23 07 03.xlsm
ABCDEFGHIJKLMNOP
12814252889101422
289101422612132223
361213222327141721
4271417212351627
52351627Total 49131624Total
64913162433568264
Count
Cell Formulas
RangeFormula
G6,P6G6=SUM(--(COUNTIF(A2:E6,A1:E1)>0))
Press CTRL+SHIFT+ENTER to enter array formulas.
Thank you Peter.
Yes this works like a charm.
Appreciate your time and effort.
Thank you
 
Upvote 0
You're welcome. Thanks for the follow-up. :)
 
Upvote 0
Yes this works like a charm.
The marked solution has been changed accordingly. In your future questions, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. No further action is required for this thread.
 
Upvote 0

Forum statistics

Threads
1,215,698
Messages
6,126,270
Members
449,308
Latest member
VerifiedBleachersAttendee

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