ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Count Non-Empty Cells In Each Row (https://www.excelbanter.com/excel-worksheet-functions/445795-count-non-empty-cells-each-row.html)

Bennington

Count Non-Empty Cells In Each Row
 
I have a spreadsheet where each row consists of the name of a particular election candidate in the first column, then a space where I want a formula, and then each column after that contains the name of a voter, or nothing, if that voter didn't vote for that candidate. There are around 350 candidates and 22 voters.

I want to write a formula in the second column that will count the number of non-empty cells to its right in the row, thus counting the number of votes that candidate received.

While COUNTA(C2:X2) works just fine for the first row, I'd have to retype those numbers 350 times.

Is there any way I can make the formula refer only to the row that the formula is in, excluding the formula and the name of the candidate, of course? That way, I could place the same formula in each row. Help is appreciated.

EDIT: Solved my own problem. Didn't realize Excel adjusts cell numbers when you copy/paste.

Spencer101

Quote:

Originally Posted by Bennington (Post 1600892)
I have a spreadsheet where each row consists of the name of a particular election candidate in the first column, then a space where I want a formula, and then each column after that contains the name of a voter, or nothing, if that voter didn't vote for that candidate. There are around 350 candidates and 22 voters.

I want to write a formula in the second column that will count the number of non-empty cells to its right in the row, thus counting the number of votes that candidate received.

While COUNTA(C2:X2) works just fine for the first row, I'd have to retype those numbers 350 times.

Is there any way I can make the formula refer only to the row that the formula is in, excluding the formula and the name of the candidate, of course? That way, I could place the same formula in each row. Help is appreciated.

=COUNTA(C2:X2) WILL only refer to that row. As you copy it down it will change to =COUNTA(C3:X3) then =COUNTA(C4:X4) etc....

Carmi Sanson

Count Non-Empty Cells In Each Row
 
=countif(range,"*")

=countif(A1:A10,"*")


All times are GMT +1. The time now is 04:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com