M03B1U5
M03B1U5

Reputation: 71

How to count the number of occurences in different specific cells from a sheet 1 to another sheet 2?

In sheet 1, in cells G26, G45, G65, G85, I have the word "ok". In sheet 2, in cell A1, I want to count the number of occurrences of the word "ok" from the specified cells in sheet 1. Somehow, using countif or SUM(countifs) returns that this is not a function or #value? in the A1 cell in sheet 2.

Any ideas what I'm doing wrong?

used:

SUM(COUNTIFS(SHEET1!G26:G45:G65:G85,"OK")

and

COUNTIF(SHEET1!G26:G45:G65:G85, "OK)

None of these two work

Upvotes: 0

Views: 33

Answers (2)

cybernetic.nomad
cybernetic.nomad

Reputation: 6368

COUNTIF will only accept a single range.

Try:

=COUNTIF(SHEET1!G26:G85, "OK")

or:

=COUNTIF(SHEET1!G26:G45, "OK") + COUNTIF(SHEET1!G65:G85, "OK")

If you really must not count the cells in G46:G64

Upvotes: 3

Dominique
Dominique

Reputation: 17493

What about this:

=CountIF(SHEET1!G26:G85;"OK")

(Mind the semicolon instead of the comma)

For your information: G26:G85 means "take all the cells from G26 to G85", it does not mean "take G26 and G85", hence I didn't put the other cells, as they are in the range from G26 to G85.

Upvotes: 0

Related Questions