简体   繁体   English

MS Excel:计算一列中与其左侧的单元格编号相同的单元格的数量

[英]MS Excel: Count the number of cells in a column that have the same number as the cell to the left of it

How can I do to count the number of cells in a column, that have the same text as the cell to the left of it? 如何计算一列中与其左侧的单元格具有相同文本的单元格的数量?

Seems it should be pretty simple but I can't find a way or any answer online. 似乎应该很简单,但我找不到在线方法或任何答案。 Thank you. 谢谢。

=COUNTIF(P$2:P$125,"="&$O2) = COUNTIF(P $ 2:P $ 125,“ =”&$ O2)

=COUNTIF(P$2:P$125,"="&$O2)

This is almost perfect except the formula tries to match always with cell value of O2. 除了公式试图始终与O2的像元值匹配之外,这几乎是完美的。 Which is great for P2, but when I get to P99 for example, I want to see if it is exactly the same as O99, and similarly then equal. 这对P2来说很棒,但是例如当我到达P99时,我想看看它是否与O99完全相同,并且类似然后相等。

Use SUMPRODUCT and limit the ranges to the extents of the data while maintaining the same size of range for both columns. 使用SUMPRODUCT并将范围限制为数据范围,同时保持两列的范围大小相同。

=SUMPRODUCT(--(O$2:O$125=P$2:P$125))
'dynamic range
=SUMPRODUCT(--(O$2:index(O:O, match("zzz", O:O))=P$2:index(P:P, match("zzz", O:O))))

The -- (or double unary ) coverts the TRUE/FALSE results to ones and zeroes. -- (或双一进制 )将TRUE / FALSE结果转换为1和0。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Excel计数带有“ an”的列中的单元格数,直到下一个单元格为非“ an” - Excel count number of cells in column with “an” until next cell is non“an” 在 MS Excel 中查找前一个单元格,该单元格是列中的数字 - In MS Excel look for the previous cell that is a number in a column Excel计数A列中的单元格小于B列中的相应单元格的范围内的次数 - Excel Count number of times in range that cells in column A are less than corresponding cell in column B MS Excel-用基于颜色的单元格数量填充百分比的单元格? - MS Excel- Populate cell with a percentage based on number of cells coloured? 在MS Excel中计算具有特定数据类型的单元格数 - count number of cells with a specific data type in MS Excel Excel宏可对已排序的列中的相同单元格进行递增编号,并在单元格内容更改时将计数重置为1 - Excel macro to incrementally number identical cells in a sorted column, resetting count to 1 when cell content changes 如果不同列中的单元格是“ 1”或“ 2”,我想计算同一行中的单元格是数字,文本还是空白 - I want to count where cells in the same row are number, text or blank if a cell in a different column is “1” or “2” 在Excel中的两个单元格之间计算相同数量的字符 - Count the same number of characters between two cells in Excel 如何计算Excel工作表中列中已填充单元格的数量 - how to count of the number of filled cells in a column in an excel sheet 如何使用python计算每列excel中填充单元格的数量 - how to count number of filled cells in each column of excel using python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM