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 5th, 2002, 05:15 PM   #1
klancey
New Member
 
Join Date: May 2002
Posts: 5
Default

Heres my problem. If a cell has text in it I need my totals colum to add 1 to the total, if a cell is empty (no text) I need it to subtract 1 from my total. I'm going crazy!
If I could get totals to subtract or add (depending on what column the entry is in ) 2 or 3 if the names are seperated by a / or something that would be better. If column A has a text in it, column C (the total column) would be raised by 1. If column B had text in it, column C would be lowered by 1. If Column A had 2 names in it seperated by some character, column C would go up 2, 3 names 3, etc. Same for column B but it would be lowered by 1,2, 3 etc depending on the number of names.

[ This Message was edited by: klancey on 2002-05-05 16:15 ]

[ This Message was edited by: klancey on 2002-05-05 16:41 ]
klancey is offline   Reply With Quote
Old May 5th, 2002, 05:23 PM   #2
Nimrod
MrExcel MVP
 
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
Default

I find your posting hard to understand but i'm thinking a Countblank or counta formula should work.
Does this help ? If not please clarify what your looking for.
Nimrod is offline   Reply With Quote
Old May 5th, 2002, 05:32 PM   #3
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
Default

Quote:
On 2002-05-05 16:15, klancey wrote:
Heres my problem. If a cell has text in it I need my totals colum to add 1 to the total, if a cell is empty (no text) I need it to subtract 1 from my total. I'm going crazy!
a b total
88

smith 89
jones/wilson 87

Like that example. If I could get totals to subtract or add (depending on what column the entry is in ) 2 or 3 if the names are seperated by a / or something that would be better. The formatting is lost on my example when submitted so add some spaces.

[ This Message was edited by: klancey on 2002-05-05 16:15 ]
What I see is this:

{"","",88;
smith,"",89;
"","jones/wilson",87}

where "" stands for a blank cell.

smith makes 88 become 89.
How come the third total is 87, while we have this jones/wilson in that row?

Care to specify the rules for adding and subtracting?
Aladin Akyurek is offline   Reply With Quote
Old May 5th, 2002, 05:42 PM   #4
klancey
New Member
 
Join Date: May 2002
Posts: 5
Default

Quote:
On 2002-05-05 16:23, Nimrod wrote:
I find your posting hard to understand but i'm thinking a Countblank or counta formula should work.
Does this help ? If not please clarify what your looking for.
I tried to clatrify some. I hope it helps.
klancey is offline   Reply With Quote
Old May 5th, 2002, 05:49 PM   #5
klancey
New Member
 
Join Date: May 2002
Posts: 5
Default

Aladin-the number moves according to how many names are in the cell, and wether the names are in a add or subtract column. I don't know if its possible to do that, it would be an added bonus if so.
klancey is offline   Reply With Quote
Old May 5th, 2002, 06:22 PM   #6
Nimrod
MrExcel MVP
 
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
Default

If you don't mind me asking could you tell me what the purpose of this spreadsheet is.

[ This Message was edited by: Nimrod on 2002-05-05 17:22 ]
Nimrod is offline   Reply With Quote
Old May 5th, 2002, 06:23 PM   #7
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
Default

Quote:
On 2002-05-05 16:49, klancey wrote:
Aladin-the number moves according to how many names are in the cell, and wether the names are in a add or subtract column. I don't know if its possible to do that, it would be an added bonus if so.
Lets say that A1: houses the following sample:

{"Names1","Names2";
"wr","";
"cxs","";
"deq/dem","tu";
"","tre";
"","tre/lkj";
"weq","";
"sda","";
"","";
"ara","fsg"}

In C1 enter: Total
In C2 enter:

=(LEN(A2)>0)+(LEN(A2)-LEN(SUBSTITUTE(A2,"/","")))-(LEN(B2)>0)+(LEN(B2)-LEN(SUBSTITUTE(B2,"/","")))

In C3 enter and copy down:

=C2+((LEN(A3)>0)+(LEN(A3)-LEN(SUBSTITUTE(A3,"/",""))))-((LEN(B3)>0)+(LEN(B3)-LEN(SUBSTITUTE(B3,"/",""))))

This is what we get in column C:

{"Total";1;2;3;2;0;1;2;2;2}

Postscript. Empty cells do not affect the running total.

[ This Message was edited by: aladin akyurek on 2002-05-05 17:40 ]
Aladin Akyurek is offline   Reply With Quote
Old May 5th, 2002, 06:48 PM   #8
klancey
New Member
 
Join Date: May 2002
Posts: 5
Default

That is a good formula but I am new to excel and dont understand what it means. Can you break it down for me without carpal tunnel syndrome setting in?

[ This Message was edited by: klancey on 2002-05-05 17:53 ]
klancey is offline   Reply With Quote
Old May 5th, 2002, 06:55 PM   #9
klancey
New Member
 
Join Date: May 2002
Posts: 5
Default

Nimrod- its a census form for disabled kids who sometimes go out to the hospital. It keeps track of who is in the hospital, discharged, admitted, etc. Sometimes they go out for 1 day or 2 or the like, and we have to keep track.We also discharge and admit kids too. See http://www.saintmaryshome.org
klancey is offline   Reply With Quote
Old May 5th, 2002, 07:12 PM   #10
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
Default

Quote:
On 2002-05-05 17:48, klancey wrote:
That is a good formula but I am new to excel and dont understand what it means. Can you break it down for me without carpal tunnel syndrome setting in?

[ This Message was edited by: klancey on 2002-05-05 17:53 ]
LEN(a-cell)>0 checks the length of the value in a-cell. If length 0 then 0, otherwise 1.

The SUBSTITUTE bit substitutes "" for each /, so determining how many names are in a cell.

This is a bit terse, but it would help.

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:24 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