Check which value appeared three times in a range

adiritz

New Member
Joined
Mar 19, 2015
Messages
10
I have following formula in Cell B11.

=IF((COUNTA(A2:A10)-COUNTIF(A2:A10,A2))=6,"Y","")

It checks if the value of A2 cell appeared 3 times in a last nine rows and show Y or else remain blank.

I want to check values of all 9 cells from A2:A10 and display VALUE in B11 only if following conditions are met:

1. there is only one value in 9 cells which have appeared 3 times. All other values need to be 2 or below.


So for eg.

A
A
B
C
D
E
F
A

IT SHOULD DISPLAY 'A'

A
B
B
B
B
C
D
D
D

It should display NONE, as more than one value have appeared 3 times or more

A
A
A
B
A
C
D
E
F

It should display NONE, as A has appeared more than 3 times in last 9 rows

Thanks for all your help.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
What is the result when the following is given?

Row\Col
A​
2​
D
3​
B
4​
B
5​
B
6​
B
7​
C
8​
D
9​
D
10​
D
11​
B

What is the result if D of A2 occurs 4 times?
 
Upvote 0
Maybe something like this


A
B
1
Values​
2
A​
3
A​
4
B​
5
C​
6
D​
7
E​
8
F​
9
A​
Value​
10
F​
A​
11
A​
12
B​
13
B​
14
B​
15
B​
16
C​
17
D​
18
D​
Value​
19
D​
NONE​
20
A​
21
A​
22
A​
23
B​
24
A​
25
C​
26
D​
27
E​
Value​
28
F​
NONE​

Array formula in B10
=IF(AND(SUMPRODUCT(--(COUNTIF(A2:A10,A2:A10)=3))=3,SUMPRODUCT(--(COUNTIF(A2:A10,A2:A10)>3))=0),INDEX(A2:A10,MATCH(3,COUNTIF(A2:A10,A2:A10),0)),"NONE")
Ctrl+Shift+Enter

Select B9:B10 and copy (Ctrl+C)
Select B18:B19 and paste (Ctrl+V)
Select B27:B28 and paste (Ctrl+V)

Hope this helps

M.
 
Upvote 0

Forum statistics

Threads
1,216,317
Messages
6,130,020
Members
449,550
Latest member
8073662045

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