Despo
Despo

Reputation: 5

COUNTIF how many times a value appears in a column, depending the content of a cells value

i am trying this =COUNTIF(M1:M1000001;" * A1 * ") but is not working.

I want to count how many times the column dispays the content of the cell A1. Note that the content of the cell will appear as a content example:

0 A M
1 la trala
2 0 sela
3 0 copy
by these data, the result must be that the content of the cell A1 is appearing 2 times in the M column

Upvotes: 0

Views: 415

Answers (2)

vels4j
vels4j

Reputation: 11298

Check this

=COUNTIF($M$1:$M$100,"*"&A1&"*")

Upvotes: 0

Jerry
Jerry

Reputation: 71538

When you are using quotes, you are taking the literal "A1", so that COUNTIF is looking for " A1 " in your cells. What you probably wanted is this:

=COUNTIF(M1:M1000001;"*"&A1&"*")

When you put A1 outside the quotes, excel will refer to the cell A1. But then, you need to concatenate this result with the asterisks so you can search through the whole text of the cell.

Upvotes: 1

Related Questions