How to compare literals in COUNTIF

Named lists in an excel sheet refer to another sheet in the same book.

eg.

Sheet 2 has named lists (GRPCNT) contains strings

> 5
5 - 9
10 - 20
> 20

Sheet 1 uses GRPCNT to provide a list of options. Say there are three lines

A | > 5
B | > 20
C | > 5

Sheet 1 should determine the number of occurrences of each option from the list.

Problem

COUNTIF(Range, "> 5") 

returns "0" instead of "2" for the above sample data.

I need a literal comparison of something line by line

COUNTIF( Range, Sheet2!A1 ) , or 
COUNTIF( Range, "'> 5'" )

Both of the above attempts did not give the desired result.

What am I doing wrong here?

+3
source share
1 answer
COUNTIF(Range, "=> 5")

(=) > 5 (no "= > " ).

, > : , 5.

+2

Source: https://habr.com/ru/post/1730738/


All Articles