A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

countif criteria sg



 
 
Thread Tools Display Modes
  #1  
Old September 6th, 2008, 02:56 PM posted to microsoft.public.excel.worksheet.functions
Fred Loh
external usenet poster
 
Posts: 26
Default countif criteria sg

i have a column (column B) of cells with numbers in the cells. i want to
count for. example, how many cells have a number between 12 and 29. i used
=countif(B:B,"=12 and =29") but it did not work. =countif(B:B,"=12,=29")
also did not work. what is the correct syntax for the criteria in the
formula?

thanks for your help
fred
  #2  
Old September 6th, 2008, 03:04 PM posted to microsoft.public.excel.worksheet.functions
Gary''s Student
external usenet poster
 
Posts: 7,584
Default countif criteria sg

=COUNTIF(B:B,"30")-COUNTIF(B:B,"12")

--
Gary''s Student - gsnu200802
  #4  
Old September 6th, 2008, 03:12 PM posted to microsoft.public.excel.worksheet.functions
Teethless mama
external usenet poster
 
Posts: 3,722
Default countif criteria sg

=SUM(COUNTIF(B:B,{"=12","29"})*{1,-1})


"Fred Loh" wrote:

i have a column (column B) of cells with numbers in the cells. i want to
count for. example, how many cells have a number between 12 and 29. i used
=countif(B:B,"=12 and =29") but it did not work. =countif(B:B,"=12,=29")
also did not work. what is the correct syntax for the criteria in the
formula?

thanks for your help
fred

  #5  
Old September 7th, 2008, 03:08 PM posted to microsoft.public.excel.worksheet.functions
Fred Loh
external usenet poster
 
Posts: 26
Default countif criteria sg

thanks guys!

Gary's Student's solution works and the logic makes sense.

Teethless mama's solution also works but I don't understand why the need to
multiply {1,-1}

i can't get Don's solution to work. i have a "#NUM!" error.





  #6  
Old September 7th, 2008, 03:39 PM posted to microsoft.public.excel.worksheet.functions
Don Guillett
external usenet poster
 
Posts: 6,167
Default countif criteria sg

Sumproduct does not take full columns. Must use a range as I did a2:a???

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Fred Loh" wrote in message
...
thanks guys!

Gary's Student's solution works and the logic makes sense.

Teethless mama's solution also works but I don't understand why the need
to
multiply {1,-1}

i can't get Don's solution to work. i have a "#NUM!" error.






  #7  
Old September 8th, 2008, 02:50 PM posted to microsoft.public.excel.worksheet.functions
Fred Loh
external usenet poster
 
Posts: 26
Default countif criteria sg

It works! Thanks Don.

"Don Guillett" wrote:

Sumproduct does not take full columns. Must use a range as I did a2:a???

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Fred Loh" wrote in message
...
thanks guys!

Gary's Student's solution works and the logic makes sense.

Teethless mama's solution also works but I don't understand why the need
to
multiply {1,-1}

i can't get Don's solution to work. i have a "#NUM!" error.







 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:22 AM.


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