countif every nth cell for exact matches

时间:2016-08-31 18:43:46

标签: excel formula countif

I need to do a countif that will count every other, odd cell. It needs to countif for exact matches, so if I'm looking for "1", it doesn't also count when a 1 appears in 10, 11, 12, etc.

I've referenced the question linked below, which has gotten me pretty close, but this is outside what I've done in the past, so I'm not quite getting there.

This is what I have now, but it's returning every time a 1 appears:

=SUMPRODUCT(--(MOD(COLUMN($B$6:$BY$6)-COLUMN($B$6)+1,2)=1),ISNUMBER(SEARCH("1",$B$6:$BY$6))+0)

(Converted to a question from here: How to use Excels COUNTIF in every nth cell and retain wildcard functionality)

2 个答案:

答案 0 :(得分:0)

=SUMPRODUCT(N(ISODD(COLUMN(myRange))*myRange=1))

其中myRange$B$6:$BY$6

计算1出现在奇数列(E,I,Q)中的单元格。如果您更喜欢偶数列,请将ISODD更改为ISEVEN

enter image description here

答案 1 :(得分:-1)

好吧,我无法在评论中粘贴任何内容,但这就是我所拥有的内容。最重要的数据集是它在报告中的显示方式。底部只是一个测试区域。该公式计算工作除了" 1"在这一刻。单独一个只有1个实例,但是公式返回6,因为它计算10和11的实例。因为我的数字将超过11,我需要将它仅计数1和#39 ; s和2&是它们是单个数字。

Screen Capture