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 9th, 2002, 09:21 PM   #1
katiekat
New Member
 
Join Date: May 2002
Posts: 2
Default

Hi, I'm a rookie, and would appreciate help.
my spread sheet looks something like this.
A B
79/6:30am 235/11:30am
The numbers before the forward slash eg: 79 and 235 are blood sugar numbers and after the forward slash are the times they were taken.
I want to develop a formula so that when the blood sugar numbers are below 80 the cell is red and when numbers are over 180 the cell is blue. I'm finding it difficult to find a formula that will change the cell color based on numbers before the slash and ignore the ones after it. Thanks
katiekat is offline   Reply With Quote
Old May 9th, 2002, 09:37 PM   #2
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Quote:
On 2002-05-09 20:21, katiekat wrote:
Hi, I'm a rookie, and would appreciate help.
my spread sheet looks something like this.
A B
79/6:30am 235/11:30am
The numbers before the forward slash eg: 79 and 235 are blood sugar numbers and after the forward slash are the times they were taken.
I want to develop a formula so that when the blood sugar numbers are below 80 the cell is red and when numbers are over 180 the cell is blue. I'm finding it difficult to find a formula that will change the cell color based on numbers before the slash and ignore the ones after it. Thanks
If the blood pressure readings are in cells A1 and B1
and the lower and upper limits of interest are incells A2 and A3
then use the following Conditional formula for cells A1 and B1
Condition1 ... Formula is:
=LEFT(A1,FIND("/",A1,1)-1)+0 Format|Pattern -- color --> 'red'

Condition2 ... Formula is:
=LEFT(A1,FIND("/",A1,1)-1)+0>A3 ...
Format|Pattern -- color --> 'blue'

Please post back if it works for you ... otherwise explain a little further and let us take it from there!


_________________
Yogi Anand
Edit: Deleted inactive web site reference from hard code signature line

[ This Message was edited by: Yogi Anand on 2003-01-19 17:17 ]
Yogi Anand is offline   Reply With Quote
Old May 9th, 2002, 09:38 PM   #3
dsnbld
Board Regular
 
Join Date: May 2002
Posts: 206
Default

The sugar levels and reletive times need to be in two different columns/cells. Then you can use conditional formatting [Menu/Format/Conditional Formatting].

Yogi posted at the same time I did...go with his post.

[ This Message was edited by: dsnbld on 2002-05-09 20:39 ]
dsnbld is offline   Reply With Quote
Old May 9th, 2002, 09:42 PM   #4
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Quote:
On 2002-05-09 20:38, dsnbld wrote:
The sugar levels and reletive times need to be in two different columns/cells. Then you can use conditional formatting [Menu/Format/Conditional Formatting].
Hi dsnbld:
You are right in that it would be simpler to do it that way -- however, see my post above, wherein I have extracted the values of interest from the associated strings, coerced them into numbers and then I applied the Conditional formatting.

Regards!
__________________
Regards!

Yogi Anand, D.Eng, P.E.
Energy Efficient Building Network LLC
www.energyefficientbuild.com
Yogi Anand is offline   Reply With Quote
Old May 9th, 2002, 09:46 PM   #5
Jay Petrulis
MrExcel MVP
 
Jay Petrulis's Avatar
 
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
Default

Hi,

Welcome to the board.

If A1 has the 79/6:30am entry, do the following

1. Select A1

2. Pull down the Format menu
Format>Conditional Formatting

3. Condition1
Formula Is
=(LEFT($A$1,SEARCH("/",$A$1,1)-1)+0)<80
and then Format as Red

4, Condition1
Formula Is
=(LEFT($A$1,SEARCH("/",$A$1,1)-1)+0)>180
and then Format as Blue

Adjust the range to match your data and format all the cells in this manner.

Bye,
Jay

EDIT: It is amazing what a browser refresh will do. Sorry about the duplicate post. Nice job, Yogi.

[ This Message was edited by: Jay Petrulis on 2002-05-09 20:48 ]
Jay Petrulis is offline   Reply With Quote
Old May 9th, 2002, 09:47 PM   #6
dsnbld
Board Regular
 
Join Date: May 2002
Posts: 206
Default

Yogi- see my edit.
dsnbld is offline   Reply With Quote
Old May 9th, 2002, 09:57 PM   #7
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Hi Katiekat:
My formula for Condition1 shoul read

=Left(A1,find("/",A1,1)-1)+0
but it does not show correctly in my post, even though I have input it correctly. I have had this problem a number of times, when my input does not match what the board shows -- perhaps some one will clarify for me why is this happening in some cases but not all the cases.

Hi Jay:

Our responses are pretty identical except for the difference I noted above, and in your formula it says Condition1 twice -- second time around it should be Condition2.

Regards!

_________________
Yogi Anand
Edit: Deleted inactive web site reference from hard code signature line

[ This Message was edited by: Yogi Anand on 2003-01-19 17:18 ]
Yogi Anand is offline   Reply With Quote
Old May 10th, 2002, 12:07 AM   #8
katiekat
New Member
 
Join Date: May 2002
Posts: 2
Default

Thanks but no luck. This spreadsheet has a several month history of blood sugar numbers. I want to be able to automatically color the high and low numbers. Each cell has different numbers and times. If sugar level is below 80 it is "low" and I want to be able to highlight it automatically. If the number is over 180 I aslo need to highlight that a different color as that is a "high" blood sugar number. Between 80 and 180 is Ok and is not colored. The top of the spreadsheet has headings over each respective columms like Breakfeast Lunch Dinner and Bedtime. The left rows have the dates and days of the week. Each individual cell has both the blood sugar level and the time it was taken. these are seperated in each cell by a forward slash. EG: 59/6:02pm.
If the blood sugar happens to be 67 at 5pm then I type in the cell 67/5:00pm I want that to automatically turn red when I press enter. because it is under 80. and Blue if it is over 180 regardless of what cell column or row I am using and regardless of what time the blood sugar was taken. Thanks again for your help
Katie
katiekat is offline   Reply With Quote
Old May 10th, 2002, 01:06 AM   #9
Brian from Maui
Board Regular
 
Brian from Maui's Avatar
 
Join Date: Feb 2002
Posts: 7,743
Default

Katie,

Do give up so fast!

Highlight the columns or range with the sugar levels and use Yogi's or Jay's formula. You can do more than one cell at a time. It shouldn't take you too long to do it.
Brian from Maui is offline   Reply With Quote
Old May 10th, 2002, 08:56 AM   #10
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Quote:
On 2002-05-10 00:06, Brian from Maui wrote:
Katie,

Do give up so fast!

Highlight the columns or range with the sugar levels and use Yogi's or Jay's formula. You can do more than one cell at a time. It shouldn't take you too long to do it.
Hi Katie:
Just like Brian said, the Conditional Formating formulas that have been posted in response to you question have been setup for one cell -- and now here is the beauty of Excel. Nowcopy the cell that's been correctly formatted, and copy its format to all the other cells , hundreds, thousands, or tens of thousands, at no extra charge.

Please post back if it works for you ... otherwise explain a liitle further and let us take it from there.

Katie, if you want you can email your file with some recods -- i can look at it and mark which cells will have to have conditional formatting and how that will be done.

NB:
I have taken your Low and High levels as cell references -- that means, should you need to update the numbers associated with tracking the Low and High end values, you would have to change the numbers in one place and not hundreds or thousands of locations.

_________________
Yogi Anand
Edit: Deleted inactive web site reference from hard code signature line

[ This Message was edited by: Yogi Anand on 2003-01-19 17:18 ]
Yogi Anand 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 02:20 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