Count repeated word

skhou

Board Regular
Joined
May 22, 2007
Messages
83
Hi,

I'm just trying to create a formula where for a given column it will only return a value say "X", if a specific "word" (e.g Rob) is repeated more then 3 times immediately in a row below or above it, otherwise return "A". For example:

Rob -X
Rob -X
Rob -X
Rob -X
Janet -A
Janet -A
Rob -A
Rob -A

I tried the countif formula but that counts every instance of that word in the entire column whereas I only want to count it if it is appears immediately in the row below or above it.

thanks
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Hi,

If you can have 2 empty rows:


Book1
AB
1
2
3RobX
4RobX
5RobX
6RobX
7JanetA
8JanetA
9RobA
10RobA
Sheet244
Cell Formulas
RangeFormula
B3=IF(OR(COUNTIF(A1:A3,A3)=3,COUNTIF(A3:A5,A3)=3),"X","A")


Formula copied down.
 
Last edited:
Upvote 0
Hello,

Thank you for that. And if I wanted to check if it was repeated 5 times then I just change the formula to =5?

Regards,

skhou
 
Upvote 0
Here is a way that does not require the extra blank row(s) at the top - it does require 1 (header?) row only.
Make sure the $1000 is something well past the end of your data.
Just change the single 3 to check for a different number of repeats.

Excel Workbook
AB
1Data
2RobX
3RobX
4RobX
5RobX
6JanetA
7JanetA
8RobA
9RobA
Check Multiples
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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