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 16th, 2002, 08:02 PM   #1
Phylis Sophical
New Member
 
Join Date: Jan 2002
Location: Canada
Posts: 42
Default

In A1 to A5, I have blank cells that I will eventually insert values into. A6 contains the total of A1 to A5 example:=sum(A1:A5)

In B1 to B5, I want to divide the number in column A by
the total (A6)
formula is: =A1/A6 and so on.

The problem is that if I don't have a value in A1 to A5 yet, the the formula cells in column B show #DIV/0!
What can I put in that formula to make the B cells show nothing until there is a value in the A cells.

I have a small checkbook worksheet I got off that net that has something simular where nothing shows in the balance column until there is a date in the first column. It looks like this:
=IF(B35="","",(G34-E35+F35))
The double quotes and comma's have something to do with 'if there is not a date in the date column, don't show anything in the balance column. In other words, there is no entry there yet.

I know this is an awfully long explanation. I'm sure there is a fancy Excel word I am looking for, but that's the problem, I don't know what that's called. Can someone tell me what I need in that formula and what Excel calls it when you don't want anything to show in the formula column until there
is data entered that relates to the formula.
Phylis Sophical is offline   Reply With Quote
Old Apr 16th, 2002, 08:14 PM   #2
barryt
New Member
 
Join Date: Apr 2002
Posts: 15
Default

use this for cell b2
then fill it down
=IF(A1=0,0,(A1/$A$6))


barryt is offline   Reply With Quote
Old Apr 16th, 2002, 08:17 PM   #3
Waxaholic
Board Regular
 
Join Date: Apr 2002
Posts: 68
Default

Try wrapping your formula in this:

=IF(ISERROR(your formula),"",your formula)

The quotes can be substituted with a 0 if you like.

Waxaholic
Waxaholic is offline   Reply With Quote
Old Apr 16th, 2002, 08:34 PM   #4
Phylis Sophical
New Member
 
Join Date: Jan 2002
Location: Canada
Posts: 42
Default

That worked, thanks. barryt, why do you use 2 zero's? Is there a time you would use 1 or 3 zero's? What is the difference between using zero's and double quotes? I'm just curious as I have to do this often with varying things in the cell. Dates, dollar amounts, plain numbers, etc.
Phylis Sophical is offline   Reply With Quote
Old Apr 16th, 2002, 08:40 PM   #5
Lighting
 
Join Date: Apr 2002
Posts: 11
Default

Quote:
On 2002-04-16 19:34, Phylis Sophical wrote:
That worked, thanks. barryt, why do you use 2 zero's? Is there a time you would use 1 or 3 zero's? What is the difference between using zero's and double quotes? I'm just curious as I have to do this often with varying things in the cell. Dates, dollar amounts, plain numbers, etc.
Hi,

Double quotes is when the cell is empty.

Lighting
Lighting is offline   Reply With Quote
Old Apr 16th, 2002, 08:43 PM   #6
Phylis Sophical
New Member
 
Join Date: Jan 2002
Location: Canada
Posts: 42
Default

And what's the difference with double zero's? Why would you use one verses the other?
Phylis Sophical is offline   Reply With Quote
Old Apr 16th, 2002, 09:00 PM   #7
Phylis Sophical
New Member
 
Join Date: Jan 2002
Location: Canada
Posts: 42
Default

Well I got smart and looked in Help for the error message. Apparently the double quotes denotes a text string which explains it's use in the date column of my checkbook. It would follow then that double zero's denote number strings.

On the other hand, Wax, your formula with the quote marks worked too. Thanks from the bottom line of my spreadsheet!
Phylis Sophical is offline   Reply With Quote
Old Apr 17th, 2002, 01:11 AM   #8
barryt
New Member
 
Join Date: Apr 2002
Posts: 15
Default

=IF (A1=0,0,(A1/$A$6))

I used a1=0 instead of a1="" because if the cell has a value of 0 instead of a blank cell you would still get the error message

If a1 =0 then it makes the cell = 0 or i you could have it make it blank

When a1 doesn't = 0 then it put the a1/$a$6 formula in and it able to calculate it

Another way that you could do the formula instead of the =IF (A1=0,0,(A1/$A$6))
Is
If($a$6 =0,0,(a1/$a$6))
This is what you would put in the cell b1
Then you could fill it down to b5
barryt is offline   Reply With Quote
Old Apr 17th, 2002, 08:01 AM   #9
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Frequently, I see IFs such as...

=IF(B1=0,0,A1/B1)

This formula has an unnecessary relational operator (bolded above) which requires additional processor time.

=IF(B1,A1/B1,0) does exactly the same thing without this comparison because Excel's logical functions treat all non-zero numeric values as TRUE and 0 as FALSE.
Mark W. is offline   Reply With Quote
Old Apr 17th, 2002, 10:47 AM   #10
Phylis Sophical
New Member
 
Join Date: Jan 2002
Location: Canada
Posts: 42
Default

Thanks Marc the true / false values (0=false) alone increase my learning curve by 50%. Understanding the logic of Excel is half the battle.
Phylis Sophical 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 06:55 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