PDA

View Full Version : [SOLVED:] Excel 2013>OFFSET>Count visible columns in a row that are >0



aworthey
07-18-2016, 12:55 PM
Hello,

I'm trying to count visible columns in a row that are greater than 0. This formula works EXCEPT for the "visible" criterion:

=COUNTIF(F26:T26,">0")

I've found some discussions about using an unusual behavior of the OFFSET function. I've tried a few things but I'm not quite understanding it. Here's my attempt:

=SUMPRODUCT(SUBTOTAL(103,OFFSET(A2,,COLUMN(F26:T26)-COLUMN(F26:T26),,)),(F26:T26>0))

Does anyone have experience with this?

Thanks so much!!

mancubus
07-18-2016, 11:58 PM
??
https://wmfexcel.com/2015/08/29/a-trick-to-sum-visible-columns-only-without-vba/

mancubus
07-19-2016, 12:08 AM
attached is a sample file downloaded from that site and adopted to count function.

row 6 in this file is the helper row to create a condition for testing the visibility of the column.

aworthey
07-19-2016, 06:27 AM
Thanks, mancubus! What a simple solution!! Worked great...I just selected a white font color to conceal my helper row.

I will mark this thread as solved. But I'm still curious about how the OFFSET approach might work--just to enrich my understanding of Excel for future problem-solving.