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:
- Count text that occurs multiple times in excel cell
- Count occurences of a specific text string in a column in excel
- Lookup with multiple criteria and display multiple search results using excel formula, part 2
- Lookup with multiple criteria and display multiple search results using excel formula
- Lookup with multiple criteria and display multiple search results using excel formula, part 3
- Lookup with multiple criteria and display multiple search results using excel formula, part 4
- Search for multiple text strings in multiple cells in excel, part 2
- Search for a text string in an excel table
- Search for multiple text strings in multiple cells in excel
- Filter unique distinct values where adjacent cells contain search string in excel




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.