最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Counting non-hidden rows which contain a value other than zero in Excel - Stack Overflow

programmeradmin1浏览0评论

I have a table in Excel called TMarks.

It includes a column called AdjustedMark, which contains values between zero and 100.

Sometimes the data in this table may be filtered. I want to count the number of rows where the AdjustedMark is greater than zero, ignoring hidden rows. I have created the following formula:

=AGGREGATE(3, 7, TMarks[AdjustedMark]/(TMarks[AdjustedMark]<>0))

However, this formula is returning a #Value error, and I don't understand why. I have also tried this as an alternative:

=AGGREGATE(9, 5, (TMarks[AdjustedMark]>0)*1)

But this also returns #VALUE!

All the rows in the AdjustedMark column of the table are numeric.

I have a table in Excel called TMarks.

It includes a column called AdjustedMark, which contains values between zero and 100.

Sometimes the data in this table may be filtered. I want to count the number of rows where the AdjustedMark is greater than zero, ignoring hidden rows. I have created the following formula:

=AGGREGATE(3, 7, TMarks[AdjustedMark]/(TMarks[AdjustedMark]<>0))

However, this formula is returning a #Value error, and I don't understand why. I have also tried this as an alternative:

=AGGREGATE(9, 5, (TMarks[AdjustedMark]>0)*1)

But this also returns #VALUE!

All the rows in the AdjustedMark column of the table are numeric.

Share Improve this question edited Mar 5 at 16:46 Scott Craner 153k10 gold badges51 silver badges87 bronze badges asked Mar 5 at 16:38 Andrew RichardsAndrew Richards 3371 silver badge12 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 3

AGGREGATE does not allow ARRAYS in the third criterion for types with a numerical value less than 14. For 3 and 9 the area must be ranges.

Instead use COUNT(FILTER())

=COUNT(FILTER(TMarks[AdjustedMark],(TMarks[AdjustedMark]>0)*(SCAN(0,TMarks[AdjustedMark],LAMBDA(z,y,SUBTOTAL(3,y))))))

The SCAN() will return an array of 1s and 0s. 1 for visible and 0 for hidden, row by row. Then by multiplying this with the secondary check for 0 value we get an array of rows that match both. Then Filter returns those values and they are counted.

发布评论

评论列表(0)

  1. 暂无评论