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 24th, 2002, 02:39 PM   #1
marymargaret
New Member
 
Join Date: May 2002
Posts: 12
Default

i have 5 cells...1st cell value determines value of 5th cell. IF cell B1 = 24, i would like E1 to display .70. IF B1=25, E1 would be .75. IF cell B1=26, E1 would be .80. Is there some way for me to do this? i was only able to put one IF formula in at a time. Any help greatly appreciated. Thanks.
marymargaret is offline   Reply With Quote
Old May 24th, 2002, 03:03 PM   #2
sen_edp
Board Regular
 
sen_edp's Avatar
 
Join Date: Mar 2002
Location: Hellas
Posts: 553
Default

hello MaryMargaret

You can use the vlookup function to do this.
take a look at the example below
Microsoft Excel - PIVOT TABLE EXAMPLE.xls___Running: xl2000 : OS = Windows (32-bit) NT 5.00
(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp
I12=

A
B
C
D
E
F
1

25

:alert('=VLOOKUP(B1,D5:E11,2,FALSE)')>75
2






3






4






5



2470
6



2575
7



2680
8



2785
9



2890
10



2995
11



30100
12






Sheet2

To see the formula in the cells just click on the cells hyperlink

The above image was automatically generated by [HtmlMaker V1.28]
If you want FREE SOFT, click here and Colo will email the file to you
This code was graciously allowed to be modified: by Ivan F Moala All credit to Colo


you can expand the list if you want with more values

and another way of doing it herebelow

Microsoft Excel - PIVOT TABLE EXAMPLE.xls___Running: xl2000 : OS = Windows (32-bit) NT 5.00
(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp
D7=

A
B
C
D
E
F
1

25
binary logic way:alert('=((B1=24)*70)+((B1=25)*75)+((B1=26)*80)+((B1=27)*85)+((B1=28)*90)+((B1=29)*95)+((B1=30)*100)')>75
2






3






4






5






6






Sheet2

To see the formula in the cells just click on the cells hyperlink

The above image was automatically generated by [HtmlMaker V1.28]
If you want FREE SOFT, click here and Colo will email the file to you
This code was graciously allowed to be modified: by Ivan F Moala All credit to Colo

_________________
Best Regards,
Andreas
using Excel 2000 - Windows 2000 prof.

[ This Message was edited by: sen_edp on 2002-05-24 14:16 ]
sen_edp is offline   Reply With Quote
Old May 24th, 2002, 03:12 PM   #3
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-05-24 13:39, marymargaret wrote:
i have 5 cells...1st cell value determines value of 5th cell. IF cell B1 = 24, i would like E1 to display .70. IF B1=25, E1 would be .75. IF cell B1=26, E1 would be .80. Is there some way for me to do this? i was only able to put one IF formula in at a time. Any help greatly appreciated. Thanks.
A bit fancy but efficient:

=(B1>=24)*0.7+(B1>=24)*(B1-24)*0.05

One thing that is missing is what is upper limit for B1 or E1.
Aladin Akyurek is offline   Reply With Quote
Old May 24th, 2002, 03:17 PM   #4
marymargaret
New Member
 
Join Date: May 2002
Posts: 12
Default

Thank you so much for your reply. the vlookup is going to take some studying for me. would it be possible for you to make hyper links for a couple more numbers in the E column so i can try to figure this one out? my manual isn't very thorough. in fact it doesn't even talk about vlookup. aghhh! thanks again.
marymargaret is offline   Reply With Quote
Old May 24th, 2002, 03:21 PM   #5
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Andreas' solution is very comprehensive, and will cover all the bases for you.
However in response to you question whether an IF function can be used ...

=IF(B1=24,0.7,IF(B1=25,0.75,IF(B1=26,0.8,"somethingelse")))

Regards!

_________________
Yogi Anand

Edit: Deleted inactive website from hardcoded signature

[ This Message was edited by: Yogi Anand on 2003-01-19 12:55 ]
Yogi Anand is offline   Reply With Quote
Old May 24th, 2002, 03:32 PM   #6
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

There are 2 reasonable routes: The VLOOKUP or the "binary" route I suggested. I'd avoid any longish IF route even if recommended or mentioned by the doctor.

[ This Message was edited by: Aladin Akyurek on 2002-05-24 14:34 ]
Aladin Akyurek is offline   Reply With Quote
Old May 24th, 2002, 03:34 PM   #7
sen_edp
Board Regular
 
sen_edp's Avatar
 
Join Date: Mar 2002
Location: Hellas
Posts: 553
Default

Hello Yogi

The bad thing about nested if statements is the limit of seven , otherwise they work pretty good.


__________________
Best Regards
Andreas
sen_edp is offline   Reply With Quote
Old May 24th, 2002, 03:43 PM   #8
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Hi Andreas and Aladin:
I fully agree with the statements from both of you. I qualified my response with the statement that marymargaret sort of inquired in the original post whether the IF function can be used.

Regards!

Edit: corrected spelling mistake for Andreas

[ This Message was edited by: Yogi Anand on 2002-05-24 19:44 ]
Yogi Anand is offline   Reply With Quote
Old May 24th, 2002, 04:48 PM   #9
marymargaret
New Member
 
Join Date: May 2002
Posts: 12
Default

hello all, many thanks for the wonderful info. i actually was very lucky in the fact that my range was 24-30 (7 fields! yeah!) so the IF condition does the trick for me. i am so thankful, because the vlookup was looking pretty intimidating. thank you all.
marymargaret is offline   Reply With Quote
Old May 27th, 2002, 02:34 PM   #10
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

=TREND({0.7,0.75},{24,25},B1)
Mark W. 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:35 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