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 Apr 28th, 2002, 04:53 PM   #1
Kevuas
New Member
 
Join Date: Apr 2002
Location: UCONN
Posts: 8
Default

Help!

I am trying to count all the occurrances of a multiple condition worksheet, with the data arranged as:

A1 : W or L
A2 : X%

B1 : W or L
B2 : X%

... up to 100 or some rows.

I want to count all the occurrances of a "W" with a certain percentage, say ">50%". I want all "L"s to be ignored.

The problem is that the % is entered as a calculation from the formula below:

A2 = IF(ISNUMBER(X1),X1/some total number,""),

so that it returns an empty cell instead of "0%" when there is no number in X1.

I can't figure out how to do a bi-conditional comparison to count all occurrances of a "W" and ">50%" because of the formula. I tried the suggestions below but have not been successful yet.

[ This Message was edited by: Kevuas on 2002-04-28 17:04 ]
Kevuas is offline   Reply With Quote
Old Apr 28th, 2002, 05:01 PM   #2
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

in K2,

=SUMPRODUCT((A1:I1="W")*(A2:I2>50%))

this should get you started
__________________
:: Pharma Z - Family drugstore ::
Chris Davison is offline   Reply With Quote
Old Apr 28th, 2002, 05:04 PM   #3
Kevuas
New Member
 
Join Date: Apr 2002
Location: UCONN
Posts: 8
Default



[ This Message was edited by: Kevuas on 2002-04-28 17:04 ]
Kevuas is offline   Reply With Quote
Old Apr 28th, 2002, 05:09 PM   #4
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

no worries !

your data can't extend very far (ie max 255 columns) so this formula is okay...

If you like what it does, I'd recommend you do a search on this site for "SUMPRODUCT", particularly Aladin's work

and also Database Functions if you're going to need the same sorts of enquiries on larger databases with lots of rows of info

Chris Davison is offline   Reply With Quote
Old Apr 28th, 2002, 05:22 PM   #5
Kevuas
New Member
 
Join Date: Apr 2002
Location: UCONN
Posts: 8
Default

Ok, I might have made a mistake explaining this (sorry I'm new). What I want to count is the times when BOTH conditions are met. In other words, I want a bi-conditional statement, where A1 HAS to be a "W" and A2 HAS to be over 50%. It seems as if the previous formula only counts "W' and over 50% regardless of position.

Another note: the cells might or might not contain a %, but they will always have a "W' or a "L".
Kevuas is offline   Reply With Quote
Old Apr 28th, 2002, 05:27 PM   #6
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

are you sure you typed it correctly ?

it will only count when BOTH conditions are met.....a "W" and >50%

Are you percentages actually numbers ? Test by =ISNUMBER(A2) if it returns FALSE you have a problem and willneed to convert those textual percentages to numeric values

try this :

=SUMPRODUCT((A1:I1="W")*((A2:I2)*1>50%))

[ This Message was edited by: Chris Davison on 2002-04-28 16:32 ]
Chris Davison is offline   Reply With Quote
Old Apr 28th, 2002, 05:35 PM   #7
Kevuas
New Member
 
Join Date: Apr 2002
Location: UCONN
Posts: 8
Default


Ok, that is the problem. I have a conditional statement to calculate the %. Because I didn't want cells to show up as "0%", (I only want cells to calculate a percent when there is actually a percent to be calculated), I use the statement :

A2 = IF(ISNUMBER(X1),X1/another number,"")

So that it returns a blank cell when there is no number. It only does the calculation when there is a number in that cell. This explains why I have been having trouble working with it. Any way you might suggest to handle this?
Kevuas is offline   Reply With Quote
Old Apr 28th, 2002, 05:38 PM   #8
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

Try my above edit....


(gotta run off to bed now... 1am over here)

Someone else will be able to help if the above doesn't work, I'm sure of it

Chris Davison is offline   Reply With Quote
Old Apr 28th, 2002, 05:48 PM   #9
Kevuas
New Member
 
Join Date: Apr 2002
Location: UCONN
Posts: 8
Default


Hmmm.. getting a #VALUE error for the revised formula.
Kevuas is offline   Reply With Quote
Old Apr 28th, 2002, 09:22 PM   #10
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
Default

Quote:
On 2002-04-28 16:48, Kevuas wrote:

Hmmm.. getting a #VALUE error for the revised formula.
Try:

=SUMPRODUCT((A1:L1="W")*(ISNUMBER(A2:L2))*(A2:L2>50%))

Formula-returned blanks are bound to give problems. Better avoid using such formulas when the returned results are subject to further computations.

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 07:33 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