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 10th, 2002, 03:11 PM   #1
ant
New Member
 
Join Date: May 2002
Posts: 8
Default


Hello all,

I hope this question makes sense. I have a column that is filled with numbers coming from an IF statement.

The IF statement either returns a value or "".

I want to count the number of cells that have values, and not the "", but I keep getting "" returned as a value.

Do any of you gurus know how to count just the cells with numbers in them and/or turn the "" into something else that is not counted in the COUNT formula???

THANKS!!
ant is offline   Reply With Quote
Old May 10th, 2002, 03:15 PM   #2
Mark O'Brien
MrExcel MVP
 
Mark O'Brien's Avatar
 
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
Default

Why not use the COUNTIF function?
__________________
Mark O'Brien

Columbus Ohio Celtic Supporters Club
Mark O'Brien is offline   Reply With Quote
Old May 10th, 2002, 03:16 PM   #3
sen_edp
Board Regular
 
sen_edp's Avatar
 
Join Date: Mar 2002
Location: Hellas
Posts: 553
Default

Hi Ant

You can use the counta() function

this function count only cells with values,text,or logical values (true or false)

Hope that helps
__________________
Best Regards
Andreas
sen_edp is offline   Reply With Quote
Old May 10th, 2002, 03:21 PM   #4
IML
MrExcel MVP
 
Join Date: Feb 2002
Location: Denver, CO
Posts: 1,744
Default

something seems fishy here. You only want to count the numbers and by default count only counts numbers. Are you sure you're populated with a "" and your range is okay???
IML is offline   Reply With Quote
Old May 10th, 2002, 03:23 PM   #5
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,315
Default


COUNT ignores "" even if generated by a formula and cannot return "" as result.

Aladin Akyurek is offline   Reply With Quote
Old May 10th, 2002, 03:33 PM   #6
ant
New Member
 
Join Date: May 2002
Posts: 8
Default

I've been looking for guys like you!!

Thanks for the suggestions.

I believe my range is correct.

I think Count.if sounds right, but I must be employing it wrong since it is a new function for me.

Basically, I am trying to get a total count; I imagine the process would go:
1) Check the value in the cell.
2) If the value is "", dont count it, otherwise, count it and move to the next cell.
3) At the end of say 25 cells, I should have the total of all the cells with actual values.

Is this something for VBA or can the count.if statement check one cell, store its value, then move to the next...

Thanks again!
ant is offline   Reply With Quote
Old May 10th, 2002, 03:49 PM   #7
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,315
Default

Quote:
On 2002-05-10 14:33, ant wrote:
I've been looking for guys like you!!

Thanks for the suggestions.

I believe my range is correct.

I think Count.if sounds right, but I must be employing it wrong since it is a new function for me.

Basically, I am trying to get a total count; I imagine the process would go:
1) Check the value in the cell.
2) If the value is "", dont count it, otherwise, count it and move to the next cell.
3) At the end of say 25 cells, I should have the total of all the cells with actual values.

Is this something for VBA or can the count.if statement check one cell, store its value, then move to the next...

Thanks again!
Microsoft Excel - COUNT.xls
File(F) Edit(E) View(V) Insert(I) Tool(T) Data(D) Window(W) Help(H)
E5=
*ABCD
1Numbers*Result of Counting*
2:alert('=IF(B2,1,"")')>*:alert('=COUNT(A2:A6)')>3*
31***
43***
5:alert('=IF(B2,1,"")')>***
612***
7****
Sheet1

You can see the formula of cells only click each above hyperlinks

The above image was automatically written by excel VBA. If you want this code, click here and I'll email the file to you.


This is intended to convince you that COUNT really ignores blanks.

A2 and A5 are blanks, generated using an IF formula.

Aladin Akyurek is offline   Reply With Quote
Old May 10th, 2002, 04:12 PM   #8
ant
New Member
 
Join Date: May 2002
Posts: 8
Default

I think I see my problem now.

My if statement: =SE(H14="sales";U14;"") is returning - in the cell for "".

Is this a formatting problem??

Thanks again.
ant is offline   Reply With Quote
Old May 10th, 2002, 04:23 PM   #9
sen_edp
Board Regular
 
sen_edp's Avatar
 
Join Date: Mar 2002
Location: Hellas
Posts: 553
Default

my example works

Microsoft Excel - HtmlMaker.xls
File(F) Edit(E) View(V) Insert(I) Tool(T) Data(D) Window(W) Help(H)
A1=
ABCDE
1
2
3 sales:alert('12345')>=IF(B3="sales",C11,"")
4 no sales:alert('')>=IF(B4="sales",C12,"")
5
6
7
8
9
10
11 12345
12
Sheet1

You can see the value of cells only click each above hyperlinks


__________________
Best Regards
Andreas
sen_edp is offline   Reply With Quote
Old May 10th, 2002, 04:26 PM   #10
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,315
Default

Quote:
On 2002-05-10 15:12, ant wrote:
I think I see my problem now.

My if statement: =SE(H14="sales";U14;"") is returning - in the cell for "".

Is this a formatting problem??

Thanks again.
What is the value in U14?


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 12:38 AM.


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