fbpx
Search
Close this search box.

Excel Formula for Finding Repeated Words in a Cell

Share

Facebook
Twitter
LinkedIn

excel-repeat-word-formula-help

If you ever need to know whether a particular word is repeated in a cell (for eg: a file extension or telephone number or name of the customer) here is how you can find it.

=if(lower(cell-with-text)<>SUBSTITUTE(lower(cell-with-text),lower(word-to-check),"",2),"Yes","No")

We are using substitute() to replace the second occurance of a particular word and then compare this with original cell contents. If both are not equal, we know that the word is repeated.

For eg: =if(lower("all cats are dogs, but not all dogs are cats")<>SUBSTITUTE(lower("all cats are dogs, but not all dogs are cats"),lower("cat"),"",2),"Yes","No") would return “yes”

See related posts for more text processing using excel hacks.

Facebook
Twitter
LinkedIn

Share this tip with your colleagues

Excel and Power BI tips - Chandoo.org Newsletter

Get FREE Excel + Power BI Tips

Simple, fun and useful emails, once per week.

Learn & be awesome.

Welcome to Chandoo.org

Thank you so much for visiting. My aim is to make you awesome in Excel & Power BI. I do this by sharing videos, tips, examples and downloads on this website. There are more than 1,000 pages with all things Excel, Power BI, Dashboards & VBA here. Go ahead and spend few minutes to be AWESOME.

Read my storyFREE Excel tips book

Excel School made me great at work.
5/5

– Brenda

Excel formula list - 100+ examples and howto guide for you

From simple to complex, there is a formula for every occasion. Check out the list now.

Calendars, invoices, trackers and much more. All free, fun and fantastic.

Advanced Pivot Table tricks

Power Query, Data model, DAX, Filters, Slicers, Conditional formats and beautiful charts. It's all here.

Still on fence about Power BI? In this getting started guide, learn what is Power BI, how to get it and how to create your first report from scratch.

letter grades from test scores in Excel

How to convert test scores to letter grades in Excel?

We can use Excel’s LOOKUP function to quickly convert exam or test scores to letter grades like A+ or F. In this article, let me explain the process and necessary formulas. I will also share a technique to calculate letter grades from test scores using percentiles.

11 Responses to “Excel Formula for Finding Repeated Words in a Cell”

  1. kidakaka says:

    Nice Chandoo!! So I can now do pattern matching and tracking!

  2. Michelle says:

    Very useful!!! I had no idea it could be done... thank you!!

  3. [...] bookmarks tagged repeated Excel Formula for Finding Repeated Words in a Cell saved by 1 others     shikaiangela bookmarked on 11/11/08 | [...]

  4. azmat says:

    hi chandoo,
    i got this below formulae on another site which picks all the text appearing after "/" in a cell....however i can't understand how it works....specially if you could tell me what does this REPT function and 255 value does in this formulae.....

    =TRIM(RIGHT(SUBSTITUTE(B23,"/",REPT(" ",255)),255))

    u can call me a novice wrt formulaes......

  5. Chandoo says:

    @Kida... yeah, you can do some basic pattern matching using this other text manipulation functions.

    @Michelle: you are welcome 🙂

    @Azmat: Thanks for sharing this formula with all. Even I didn't know about this and it definitely goes in to my favorite formula tricks.

    here is how it works:
    - the formula produces portion of the cell contents after last "/" symbol.
    - assuming, the last part is not longer than 255 characters (usually the case)
    - It replaces every "/" with 255 spaces (the rept() function is doing that)
    - Now, it uses right() to extract right most 255 characters. Which probably has a bunch of spaces and then the last portion and another bunch of space.
    - Finally it uses trim to cut down spaces to provide just the string.

    If your string has more than 255 characters after the last "/" symbol, you can use even larger number like 999 in rept() and right().

  6. Glenn says:

    Is there a formula if I want to see if a word is repeated in a column?

  7. Chandoo says:

    @Glenn you can try countif()

    assuming you want to see if word "Glenn" is repeated in the range C1:C20, write something like =IF(COUNTIF(C1:C20,"*Glenn*")>1,"Repeated","Not Repeated")

  8. Mike says:

    Great formula! Thanks so much for posting it.

  9. Tarun says:

    Hi,

    I want to know what text is repeated maximum number of time in a row.

    Eg. Ram, Amitabh, Ravan, Ram, Sita, Tarun, Ram, Chandoo
    should result Ram (3 times)

    Nos. of time Ram is repeated can be calculated by countif function, but how to find what Text is repeated maximum times?

  10. Riduan says:

    Please help!!! Looked everywhere but can't get this to work.

    I have a column where each row containing different sentences. How do I check for duplicate word(s) in each cell in this particular column of various sentences?

Leave a Reply