[英]Most frequent text value in Google Sheets problem with not occurring more than once
I'm having some problems getting the most frequent value I'm using a formula that works is the next one:我在获取最频繁的值时遇到了一些问题我使用的公式是下一个:
=INDEX(A1:A9,MODE(IF((A1:A9<>"")*ISNA(MATCH(A1:A9,$B$1:$B1,0)),MATCH(A1:A9,A1:A9,0))))
But in some column the data appears like this:但在某些列中,数据显示如下:
An error when the value is not occurring more than once I would like to add some condition but I've been trying with different formulas and I did't get better results some advices or formulas that I could use please?当该值未多次出现时出现错误我想添加一些条件,但我一直在尝试使用不同的公式但我没有得到更好的结果请给我一些建议或公式?
per column:每列:
=INDEX(QUERY(A1:A9,
"select A,count(A) where A is not null group by A order by count(A) desc"), 2, 1)
per range:每个范围:
=INDEX(QUERY(FLATTEN(A1:G9),
"select Col1,count(Col1) where Col1 is not null group by Col1 order by count(Col1) desc"), 2, 1)
You can also the formula below:您还可以使用以下公式:
=ARRAYFORMULA(INDEX(A1:A10,MATCH(MAX(COUNTIF(A1:A10,A1:A10)),COUNTIF(A1:A10,A1:A10),0)))
And later drag it across the row:然后将它拖过一行:
The notable functions used for this are the following:用于此的显着函数如下:
COUNTIF
which will return the prevalent number of occurrences; COUNTIF
将返回出现的普遍次数;
MATCH
in order to match the predominant choice; MATCH
以匹配主要选择;
ARRAYFORMULA
which enables the display of values returned from an array formula into multiple rows and/or columns and the use of non-array functions with arrays. ARRAYFORMULA
允许将从数组公式返回的值显示到多行和/或多列中,并使用 arrays 的非数组函数。
Reference参考
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.