New Contributor

# Count columns contain data

Hello guys, i'm searching for some help with an Excel template, what I need in specific is to get or count columns instead of cells. I will try to explain my concern... in the excel file attached (Sample Data v1) you will see that there are several data where each column at Raw 6 represent 1 pc (A6, C6, E6... ) until complete 43 pcs, each column have 13 data which represent specification data. If one data is out of spec then is marked as RED (spec is .118 - .182)... now if you check the file there are 11 pcs (Columns) that out of specs no matter how many out of specs data have each part (some parts have more than one data out of specs) What I want to have is a formula to count how many parts (columns) are out of specs.

In the example you will see that there are 43 pcs and 11 NOK (i know because i counted manually) but i want Excel count it for me with a formula.

Hope some of you guys can help me with your experience. Let me know if further info or explanation is needed, thanks!

2 Replies

# Re: Count columns contain data

I'd use a helper row. In the attached version, I used row 21, but it can be any row.

A21 contains the formula =COUNTIF(A8:A20,"<0.118")+COUNTIF(A8:A20,">0.182") and this has been copied to C21, E21 etc.

The formula to count the number of columns with NOK is =COUNTIF(21:21,">0")

# Re: Count columns contain data

@Hans Vogelaar Hi, i really appreciate your support and quick contribution... awesome! I will use it the formula thanks a lot!