#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 80
Default Formula Help

I am trying to do the following and can't figure out the formula.

I have cells across a column that have one of the following numbers:
0,1,2,3,4. I want to get the number of cells that have a 1 or a 2.

For example, lets say A3 is a 1, C3 is a 3, E3 is a 4 and G3 is 2. I want
the forumala to give me 2 (1 in A3 and 2 in G3).

I am sure it is fairly simple, but I can't figure it out.
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Formula Help

Try:

=COUNTIF(A3:Z3,1)+COUNTIF(A3:Z3,2)

--
Gary''s Student - gsnu200909


"Casey" wrote:

I am trying to do the following and can't figure out the formula.

I have cells across a column that have one of the following numbers:
0,1,2,3,4. I want to get the number of cells that have a 1 or a 2.

For example, lets say A3 is a 1, C3 is a 3, E3 is a 4 and G3 is 2. I want
the forumala to give me 2 (1 in A3 and 2 in G3).

I am sure it is fairly simple, but I can't figure it out.
Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default Formula Help

One way would be: =SUMPRODUCT((A3:G3<0)*(A3:G3<=2))
Micky


"Casey" wrote:

I am trying to do the following and can't figure out the formula.

I have cells across a column that have one of the following numbers:
0,1,2,3,4. I want to get the number of cells that have a 1 or a 2.

For example, lets say A3 is a 1, C3 is a 3, E3 is a 4 and G3 is 2. I want
the forumala to give me 2 (1 in A3 and 2 in G3).

I am sure it is fairly simple, but I can't figure it out.
Thanks

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 80
Default Formula Help

Thanks for the suggestion. One of the problems is that I have content
between the cells. So between A3 and C3, there is a cell with a number that
I don't want as part of the final number. Is it possible to edit the formula
to just desired the columns?

"מיכאל (מיקי) אבידן" wrote:

One way would be: =SUMPRODUCT((A3:G3<0)*(A3:G3<=2))
Micky


"Casey" wrote:

I am trying to do the following and can't figure out the formula.

I have cells across a column that have one of the following numbers:
0,1,2,3,4. I want to get the number of cells that have a 1 or a 2.

For example, lets say A3 is a 1, C3 is a 3, E3 is a 4 and G3 is 2. I want
the forumala to give me 2 (1 in A3 and 2 in G3).

I am sure it is fairly simple, but I can't figure it out.
Thanks

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default Formula Help

Well..., maybe:
=SUMPRODUCT((MOD(COLUMN(A3:G3),2))*(A3:G3<=2))
Micky


"Casey" wrote:

Thanks for the suggestion. One of the problems is that I have content
between the cells. So between A3 and C3, there is a cell with a number that
I don't want as part of the final number. Is it possible to edit the formula
to just desired the columns?

"מיכאל (מיקי) אבידן" wrote:

One way would be: =SUMPRODUCT((A3:G3<0)*(A3:G3<=2))
Micky


"Casey" wrote:

I am trying to do the following and can't figure out the formula.

I have cells across a column that have one of the following numbers:
0,1,2,3,4. I want to get the number of cells that have a 1 or a 2.

For example, lets say A3 is a 1, C3 is a 3, E3 is a 4 and G3 is 2. I want
the forumala to give me 2 (1 in A3 and 2 in G3).

I am sure it is fairly simple, but I can't figure it out.
Thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"