MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old May 3rd, 2002, 08:20 AM   #1
pzamory
Board Regular
 
Join Date: May 2002
Posts: 98
Default

Hello. I would like to get a count of all items in a column which fall between a range. For instance, how many items cost more than $5 and less than $10. Can anyone help me out? Many thanks.

pzamory is offline   Reply With Quote
Old May 3rd, 2002, 08:32 AM   #2
IML
MrExcel MVP
 
Join Date: Feb 2002
Location: Denver, CO
Posts: 1,744
Default

for A1:A10, you could use
=COUNTIF(A1:A10,">"&5)-COUNTIF(A1:A10,">="&10)
IML is offline   Reply With Quote
Old May 3rd, 2002, 01:45 PM   #3
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

Quote:
On 2002-05-03 07:32, IML wrote:
for A1:A10, you could use
=COUNTIF(A1:A10,">"&5)-COUNTIF(A1:A10,">="&10)
Nice one IML,

quick query : ">5" seems to work in place of ">"&5

(although not in your second arguement, which is correct)

do you default to this just out of habit, or is there a subtelty I'm missing ?

thanks
Chris
Chris Davison is offline   Reply With Quote
Old May 3rd, 2002, 01:51 PM   #4
IML
MrExcel MVP
 
Join Date: Feb 2002
Location: Denver, CO
Posts: 1,744
Default

Quote:
On 2002-05-03 12:45, Chris Davison wrote:
Quote:
On 2002-05-03 07:32, IML wrote:
for A1:A10, you could use
=COUNTIF(A1:A10,">"&5)-COUNTIF(A1:A10,">="&10)
Nice one IML,



Chris

(although not in your second arguement, which is correct)

do you default to this just out of habit, or is there a subtelty I'm missing ?

thanks


Thanks Chris,
I think

=COUNTIF(A1:A10,">5")-COUNTIF(A1:A10,">=10")

would be considered more correct. The amperstand is a bad habit since I'm use to tying it to cells, as opposed to constants.
quick query : ">5" seems to work in place of ">"&5
IML is offline   Reply With Quote
Old May 3rd, 2002, 02:04 PM   #5
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

sounds like my "indirects" where everything is inside quotes until the variables....

your "habit" still gives the same answer, I should add, just in case the reader thinks it's a no-no

Chris Davison is offline   Reply With Quote
Old May 3rd, 2002, 02:20 PM   #6
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
Default

Quote:
On 2002-05-03 13:04, Chris Davison wrote:
sounds like my "indirects" where everything is inside quotes until the variables....

your "habit" still gives the same answer, I should add, just in case the reader thinks it's a no-no

The use of & in COUNTIF and SUMIF helps to distinguish between constants and variables. Ian's "habit", that is, ...&a-constant has a good side-effect:

When you have the following in a French or Dutch version of Excel (Excel 97, anyway):

=COUNTIF(A1:A10,">10,5")

don't try to send your WB to an American with the US version of Excel. However,

=COUNTIF(A1:A10,">"&10,5)

will give the American no problem.



Aladin
Aladin Akyurek is offline   Reply With Quote
Old May 3rd, 2002, 04:35 PM   #7
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

Aladin,

interesting !

Any insight as to why Dutch or French syntaxes are different ?

rephrase : are both syntaxes acceptable to Excel, just that Netherlands and France prefer option (a) for some reason

or is Excel actually coded differently to take account of preferences in syntax by Netherland and France ?


.... tangent : is this just Excel ? Or is it Dutch and French computing in general ? What happens when France wants to launch a rocket to the International Space Station ? is there lots of "computer translations" ?

sorry...silly questions
interesting topic though



Chris Davison is offline   Reply With Quote
Old May 3rd, 2002, 05:01 PM   #8
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
Default

Quote:
On 2002-05-03 15:35, Chris Davison wrote:
Aladin,

interesting !

Any insight as to why Dutch or French syntaxes are different ?

rephrase : are both syntaxes acceptable to Excel, just that Netherlands and France prefer option (a) for some reason

or is Excel actually coded differently to take account of preferences in syntax by Netherland and France ?


.... tangent : is this just Excel ? Or is it Dutch and French computing in general ? What happens when France wants to launch a rocket to the International Space Station ? is there lots of "computer translations" ?

sorry...silly questions
interesting topic though

[img]/board/images/smiles/icon_smile.gif[/img]

I think it's just a bug in Excel's parser itself (Excel 97).

A Dutch WB can be immediately opened with the American version. All function names will change immediately to their English version. But, this process does not seem to look at antthing between double quotes. So you get from:

=AANTAL.ARG(A1:A10,">1,6")

=COUNTIF(A1:A10,">1,6") instead of:

=COUNTIF(A1:A10,">1.6")

I've seen this happen at school (all English) with files set up in the Dutch version.

Can anyone verify this?

Aladin
Aladin Akyurek is offline   Reply With Quote
Reply

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 05:38 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes