ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   CountIf using every other column (https://www.excelbanter.com/excel-discussion-misc-queries/175775-countif-using-every-other-column.html)

duketter

CountIf using every other column
 
Excel 2003 - I am trying to count the number of times the number "2" appears
in column A1, C1, E1, G1, I1, etc. I am trying to use the countif function,
but it won't work. I can't just select every other column like I need to, it
wants me to select the entire range if that makes sense.

Is there anyway I can do this and only look at every other column or every
3rd column?

Thanks!

Gary''s Student

CountIf using every other column
 
=COUNTIF(A:A,2) + COUNTIF(C:C,2) + .......etc.
--
Gary''s Student - gsnu200767


"duketter" wrote:

Excel 2003 - I am trying to count the number of times the number "2" appears
in column A1, C1, E1, G1, I1, etc. I am trying to use the countif function,
but it won't work. I can't just select every other column like I need to, it
wants me to select the entire range if that makes sense.

Is there anyway I can do this and only look at every other column or every
3rd column?

Thanks!


michelle

CountIf using every other column
 
You might also find this posting useful. They are talking about using
COUNTIF with noncontinuous ranges, and gives an alternative solution to the
one above...

http://www.microsoft.com/office/comm...&cr=&sloc=&p=1

Hope this helps.

--
Cheers,
Michelle
"Anyone who says he can see through women is missing a lot." Groucho Marx


"duketter" wrote:

Excel 2003 - I am trying to count the number of times the number "2" appears
in column A1, C1, E1, G1, I1, etc. I am trying to use the countif function,
but it won't work. I can't just select every other column like I need to, it
wants me to select the entire range if that makes sense.

Is there anyway I can do this and only look at every other column or every
3rd column?

Thanks!


T. Valko

CountIf using every other column
 
count the number of times the number "2" appears in
column A1, C1, E1, G1, I1, etc.


Try this:

=SUMPRODUCT(--(MOD(COLUMN(A1:I1)-COLUMN(A1),2)=0),--(A1:I1=2))

--
Biff
Microsoft Excel MVP


"duketter" wrote in message
...
Excel 2003 - I am trying to count the number of times the number "2"
appears
in column A1, C1, E1, G1, I1, etc. I am trying to use the countif
function,
but it won't work. I can't just select every other column like I need to,
it
wants me to select the entire range if that makes sense.

Is there anyway I can do this and only look at every other column or every
3rd column?

Thanks!





All times are GMT +1. The time now is 05:56 AM.

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