Count number of times a string exist in multiple cells using excel formula
Question: How do I find the number of occurances a word exists in a range of cells? It does not have to be a exact match but case sensitive. Column A1:A15 is the cell range.
Answer:
Cell D1 is the search string
In D2 a formula counts the number of times the searchstring is found in A1:A15.
=SUM(IF(ISNUMBER(FIND(D1,A1:A15)),1,0)) + Ctrl + Shift + Enter
In E2:E13 i get the row number of the cell which the search string is found.
=IF(SUM(IF(ISNUMBER(FIND(D1,A1:A15)),1,0))>=ROW()-1, SMALL(IF(ISNUMBER(FIND(D1,A1:A15)),ROW(A1:A15),""),ROW()-1),"") + Ctrl + Shift + Enter
In F2:F13 is the cell value displayed.
=IF(E2<>"", INDEX($A$1:$A$15, E2), "") copied down to F13.
Not case-sensitive
Replace FIND with SEARCH in the above formula to make it not case sensitive.
Download excel sample file for this tutorial.
string-exist-in-multiple-cells
(Excel 97-2003 Workbook *.xls)
Functions used in this article
IF(logical_test;[value_if:true];[value_if_false])
Checks whether a condition is met, and returns one value if TRUE, and another value if FALSE
INDEX(array,row_num,[column_num])
Returns a value or reference of the cell at the intersection of a particular row and column, in a given range
ROW(reference) returns the rownumber of a reference
COUNT(value1;[value2])
Counts the number of cells in a range that contain numbers
SMALL(array,k) returns the k-th smallest row number in this data set.
ISNUMBER(value)
Checks whether a value is a number and returns TRUE or FALSE
This blog article is one out of three articles on the same subject.
- Count number of times a string exist in multiple cells using excel formula
- Count text that occurs multiple times in excel cell
- Count occurences of a specific text string in a column in excel
Read more related articles in the archive.
Related posts:




August 22nd, 2009 at 9:30 pm
Awesome. It is simply superb
January 23rd, 2010 at 11:49 pm
How about:
=SUM(N(ISNUMBER(FIND(D1,A1:A15))))
January 25th, 2010 at 1:00 pm
David Hager,
Yes, your formula works!
Thanks for commenting.
August 2nd, 2010 at 9:06 pm
Hello. I used this formula and is very useful. But how will look formula to search the exact string (an not only string who include) in column A? Also if i have a value in column B named price, i want to return the value from columb B associated to row of string searched in column A. How to make tthis? Thank you.
August 5th, 2010 at 12:14 pm
Adriano,
Read this post: http://www.get-digital-help.com/2009/12/29/vlookup-with-2-or-more-lookup-criteria-and-return-multiple-matches-in-excel/