Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default countif criteria sg

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

--
Gary''s Student - gsnu200802
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
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.







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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Two criteria for CountIf? DB_Bill Excel Worksheet Functions 6 June 1st 06 04:33 PM
COUNTIF with two criteria Boran Düzgün Excel Worksheet Functions 3 March 7th 06 10:43 PM
Countif using format criteria not number criteria? Rumbla76 Excel Worksheet Functions 1 April 20th 05 05:38 AM
Countif using format criteria....not number criteria? Troy Excel Worksheet Functions 1 April 20th 05 04:50 AM
countif criteria johnT Excel Worksheet Functions 5 March 28th 05 02:55 AM


All times are GMT +1. The time now is 06:14 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"