How to read a row only if it contains 1 in Excel

I have data in Excel where each row is a driver log. Each row has 5 columns, which represent 5 possible types of violations.

Sample image of data

I need to get the percentage of violation log drivers. To do this, I need to count the number of rows with a nonzero number in one of the columns. I am looking for a way to succeed to do this for me.

I would like to add a 6th column and call it the number of errors. If there is a nonzero number in the row, I would like Excel to add column number 1 to the column. Then I could summarize this column to get the total number of logs with violations.

- , ? , , ?

+4
3

COUNTIF IF:

=IF(COUNTIF(B2:F2,">=1"),1,0)

enter image description here

+5

@Scott Craner .

=IF(SUM(B2:F2),1,0)

=--(SUM(B2:F2)>0)

, CSE:

=OR(--B2:F2)

, Ctrl + Shift + Enter

</" >

, 1

=--(COUNTIF(B2:F2,1)>0)

=--OR(A1:B1=1)

Ctrl + Shift + Enter

+3

, - :

=countif(x:x,">0")/count(x:x)

excel_img

0
source

Source: https://habr.com/ru/post/1670952/


All Articles