ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   COUNTIF text where there is more than one word in a cell (https://www.excelbanter.com/excel-worksheet-functions/9506-countif-text-where-there-more-than-one-word-cell.html)

Abi

COUNTIF text where there is more than one word in a cell
 
I tried the COUNTIF function on a range of cells to count a specific word in
that range, but these cells have multiple words in them and the formula
doesn't recognize the words then.

How do I expand my countif formula to get what I need?

EXAMPLE
A1: apple and orange
A2: apple and banana
A3: apple and grapes and orange
A4: pineapple

=COUNTIF(A1:A4,"apple") is what I currently have but it returns a value of
zero. How do I get it to return the value of four that I'm looking for?

Thanks!

Peo Sjoblom

=COUNTIF(A1:A4,"*apple*")



--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)



"Abi" wrote in message
...
I tried the COUNTIF function on a range of cells to count a specific word
in
that range, but these cells have multiple words in them and the formula
doesn't recognize the words then.

How do I expand my countif formula to get what I need?

EXAMPLE
A1: apple and orange
A2: apple and banana
A3: apple and grapes and orange
A4: pineapple

=COUNTIF(A1:A4,"apple") is what I currently have but it returns a value of
zero. How do I get it to return the value of four that I'm looking for?

Thanks!




Biff

Hi!

Here's one way:

=COUNTIF(A1:A4,"*apple*")

The asterisks are wildcards.

Biff

-----Original Message-----
I tried the COUNTIF function on a range of cells to count

a specific word in
that range, but these cells have multiple words in them

and the formula
doesn't recognize the words then.

How do I expand my countif formula to get what I need?

EXAMPLE
A1: apple and orange
A2: apple and banana
A3: apple and grapes and orange
A4: pineapple

=COUNTIF(A1:A4,"apple") is what I currently have but it

returns a value of
zero. How do I get it to return the value of four that

I'm looking for?

Thanks!
.



All times are GMT +1. The time now is 08:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com