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

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
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,909
Messages
6,175,312
Members
452,634
Latest member
cpostell

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