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 Mar 11th, 2002, 06:43 AM   #1
Gaz_Royal
New Member
 
Join Date: Mar 2002
Posts: 7
Default

Ok firstly thanks for reading this post I really do need some help

I have a row of 5 codes for individual marks - P for Pass and F for Fail. In the last column I have the overall result - P if all individual results were P and F if any of the 5 results were an F.

My problem is that if no data has been entered the final result defaults to an F for Fail when in fact I would like it to show blank or space.

I think this problem is something to do with NULL value but I'm not sure what to do to resolve this. Any help or guidance will be greatly appreciated. Cheers.
Gaz_Royal is offline   Reply With Quote
Old Mar 11th, 2002, 06:50 AM   #2
Ian Mac
MrExcel MVP
 
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
Default

Please could you provid some additional information.

The formula you currently have.
The values that it's looking at.
Any expected results.
__________________
"Have a good time......all the time"
Ian Mac
Ian Mac is offline   Reply With Quote
Old Mar 11th, 2002, 07:02 AM   #3
Gaz_Royal
New Member
 
Join Date: Mar 2002
Posts: 7
Default

Ok here goes Ian

current formula
---------------

=IF(H2="P",IF(I2="P",IF(J2="P",IF(K2="P",IF(L2="P",IF(M2="P",IF(N2="P",IF(O2="P","P","F"),"F"),"F"),"F"),"F"),"F"),"F"),"F")


values that its looking at
--------------------------

9 cells, 8 containing either P for Pass, F for fail and a third data type being Null i think. The final cell is an end result cell (see below)

Expected results
----------------

If all 8 cells contain P then the end result should be P. If any cell contains F then the end result should be F. My problem is that if no data has been entered in any cell the end result defaults to F when I would like it to default to " " (space)


Cheers
Gaz_Royal is offline   Reply With Quote
Old Mar 11th, 2002, 07:47 AM   #4
Tim Francis-Wright
Board Regular
 
Join Date: Feb 2002
Posts: 74
Default

Quote:
On 2002-03-11 06:02, Gaz_Royal wrote:
Ok here goes Ian

current formula
---------------

=IF(H2="P",IF(I2="P",IF(J2="P",IF(K2="P",IF(L2="P",IF(M2="P",IF(N2="P",IF(O2="P","P","F"),"F"),"F"),"F"),"F"),"F"),"F"),"F")


values that its looking at
--------------------------

9 cells, 8 containing either P for Pass, F for fail and a third data type being Null i think. The final cell is an end result cell (see below)

Expected results
----------------

If all 8 cells contain P then the end result should be P. If any cell contains F then the end result should be F. My problem is that if no data has been entered in any cell the end result defaults to F when I would like it to default to " " (space)


Cheers
Try this control-shift-enter formula:

=IF(OR(H2:O2="",H2:O2=" ")," ",IF(AND(H2:O2="P"),"P","F"))

It should do what you want.


__________________
"Interfere? Of course we should interfere! Always do what you're best at, that's what I say!" -- The Doctor, Nightmare of Eden
Tim Francis-Wright is offline   Reply With Quote
Old Mar 11th, 2002, 07:51 AM   #5
Ian Mac
MrExcel MVP
 
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
Default

What about,

=IF(COUNTA(H2:O2)<8,"",IF(COUNTIF(H2:O2,"P")<8,"F","P"))

any help?
__________________
"Have a good time......all the time"
Ian Mac
Ian Mac is offline   Reply With Quote
Old Mar 11th, 2002, 08:02 AM   #6
Dave Hawley
Banned
 
Join Date: Feb 2002
Posts: 1,582
Default

I couldn't resist trying:

=IF(COUNTA(H2:O2)<1,"",CHOOSE(COUNTIF(H2:O2,"P"),"F","F","F","F","F","F","F","P"))
Dave Hawley is offline   Reply With Quote
Old Mar 11th, 2002, 08:04 AM   #7
Gaz_Royal
New Member
 
Join Date: Mar 2002
Posts: 7
Default

Thanks for the assistance guys...will check each one right away and let you know the outcome.
Gaz_Royal is offline   Reply With Quote
Old Mar 11th, 2002, 08:38 AM   #8
Gaz_Royal
New Member
 
Join Date: Mar 2002
Posts: 7
Default

Tim:

=IF(OR(H5:O5=" ",H5:O5=" ")," ",IF(AND(H5:O5="P"),"P","F"))

couldn't get this to work at first but then realised I'd forgotten to hit CNTRL+SHIFT+ENTER. This put a {} swirly bracket around the formula and bingo worked great. Not sure what the swirly thing does but its great

Ian:

=IF(COUNTA(H2:O2)<8," ",IF(COUNTIF(H2:O2,"P")<8,"F","P"))

This worked fine for F's and P's but didnt like my NULL cells - still defaulted to F until I physically deleted the contents of one of the 8 cells.


Dave:

=IF(COUNTA(H2:O2)<1," ",CHOOSE(COUNTIF(H2:O2,"P"),"F","F","F","F","F","F","F","P"))
Again this worked fine for F's and P's but returned "value" error for cells containing my NULL values until I deleted ALL cell contents.


Once again guys, thanks for the response - fantastic help and my problem has been sorted. Cheers.


Gaz_Royal is offline   Reply With Quote
Old Mar 11th, 2002, 03:27 PM   #9
Tim Francis-Wright
Board Regular
 
Join Date: Feb 2002
Posts: 74
Default

There's a way to do this without the array formula. It's longer but faster if you have
a large spreadsheet. (You also don't have to remember a special entry method if you
edit it.)

=IF(COUNTIF(H5:P5,"P")+COUNTIF(H5:P5,"F")<8,"",IF(COUNTIF(H5:P5,"P")=8,"P","F"))
__________________
"Interfere? Of course we should interfere! Always do what you're best at, that's what I say!" -- The Doctor, Nightmare of Eden
Tim Francis-Wright is offline   Reply With Quote
Old Mar 11th, 2002, 04:47 PM   #10
Ian Mac
MrExcel MVP
 
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
Default

Quote:
On 2002-03-11 07:38, Gaz_Royal wrote:
Tim:

=IF(OR(H5:O5=" ",H5:O5=" ")," ",IF(AND(H5:O5="P"),"P","F"))

couldn't get this to work at first but then realised I'd forgotten to hit CNTRL+SHIFT+ENTER. This put a {} swirly bracket around the formula and bingo worked great. Not sure what the swirly thing does but its great

Ian:

=IF(COUNTA(H2:O2)<8," ",IF(COUNTIF(H2:O2,"P")<8,"F","P"))

This worked fine for F's and P's but didnt like my NULL cells - still defaulted to F until I physically deleted the contents of one of the 8 cells.


Dave:

=IF(COUNTA(H2:O2)<1," ",CHOOSE(COUNTIF(H2:O2,"P"),"F","F","F","F","F","F","F","P"))
Again this worked fine for F's and P's but returned "value" error for cells containing my NULL values until I deleted ALL cell contents.


Once again guys, thanks for the response - fantastic help and my problem has been sorted. Cheers.


My formula should work fine for NULL values as should Dave's, I can only think you have the " "'s in the cells you wanted in the first place. OR are the results coming from an IF statement or LOOKUP where your return is " ", if so change to "" without the space.
__________________
"Have a good time......all the time"
Ian Mac
Ian Mac 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 01:11 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