ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Only count columns if the column next to it is not blank (https://www.excelbanter.com/excel-discussion-misc-queries/80521-only-count-columns-if-column-next-not-blank.html)

glotgering

Only count columns if the column next to it is not blank
 
Hello all,

I have a very wide spreadsheet with hundreds of columns and I only want to count the column if the column to the left of it is not blank.

My current formula is =COUNTIF(AC69:IV69,"=0") which count any value in that row as long as it is not blank

Here is an example of what I want to do. Again I only want to count columns if the column next to it contains a certain criteria, in this case an "x"

1 x 1 1 x 1 Result should = 2 (only colums next to an "x")
x 1 x 1 x 1 x 1 Result should = 4 (count all columns)
1 1 1 1 Result should = 0 (count no columns)

Can this be done?

Bernard Liengme

Only count columns if the column next to it is not blank
 
Could you just count the X's ?
=COUNTIF(AC69:IV60,"x")
Or does your explanation need enlarging?
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"glotgering" wrote in message
...

Hello all,

I have a very wide spreadsheet with hundreds of columns and I only want
to count the column if the column to the left of it is not blank.

My current formula is =COUNTIF(AC69:IV69,"=0") which count any value in
that row as long as it is not blank

Here is an example of what I want to do. Again I only want to count
columns if the column next to it contains a certain criteria, in this
case an "x"

1 x 1 1 x 1 Result should = 2 (only colums next to an "x")
x 1 x 1 x 1 x 1 Result should = 4 (count all columns)
1 1 1 1 Result should = 0 (count no columns)

Can this be done?


--
glotgering




glotgering

Quote:

Originally Posted by glotgering
Hello all,

I have a very wide spreadsheet with hundreds of columns and I only want to count the column if the column to the left of it is not blank.

My current formula is =COUNTIF(AC69:IV69,"=0") which count any value in that row as long as it is not blank

Here is an example of what I want to do. Again I only want to count columns if the column next to it contains a certain criteria, in this case an "x"

1 x 1 1 x 1 Result should = 2 (only colums next to an "x")
x 1 x 1 x 1 x 1 Result should = 4 (count all columns)
1 1 1 1 Result should = 0 (count no columns)

Can this be done?

Anyone? Anyone? Bueller?


All times are GMT +1. The time now is 04:40 AM.

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