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 26th, 2002, 10:11 AM   #1
Adrae
Board Regular
 
Join Date: Feb 2002
Location: Chicago, IL USA
Posts: 306
Default

Can anyone tell me what is wrong with this function. I'm trying to setup an "Or" scenario, where the value in less than OR equal to.

=IF(B4
Thanks
Adrae is offline   Reply With Quote
Old Mar 26th, 2002, 10:15 AM   #2
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-03-26 09:11, Adrae wrote:
Can anyone tell me what is wrong with this function. I'm trying to setup an "Or" scenario, where the value in less than OR equal to.

=IF(B4
Thanks
=(B4<=Sheet1!E4)*WIE!$F$6

Aladin Akyurek is offline   Reply With Quote
Old Mar 26th, 2002, 10:15 AM   #3
MrStressed
Board Regular
 
Join Date: Mar 2002
Location: Kent, the Garden of England, that no one has bothered to weed.
Posts: 62
Default

try this, though I might be Completely wrong.

=IF(B4<=Sheet1!E4,WIE!$F$6,0))



MrStressed is offline   Reply With Quote
Old Mar 26th, 2002, 10:22 AM   #4
Adrae
Board Regular
 
Join Date: Feb 2002
Location: Chicago, IL USA
Posts: 306
Default

Well the error is gone, but the value is 0 no matter what. The values is Sheet1!E4 & B4 are dates formatted as MM/DD/YY. Could this be the problem, and if so, any ideas how to fix it?

If B4 is equal to or less than (comes before on calendar)E4 then I want to pull a specific value from another cell, else 0.

Thanks
Adrae is offline   Reply With Quote
Old Mar 26th, 2002, 10:26 AM   #5
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-03-26 09:22, Adrae wrote:
Well the error is gone, but the value is 0 no matter what. The values is Sheet1!E4 & B4 are dates formatted as MM/DD/YY. Could this be the problem, and if so, any ideas how to fix it?

If B4 is equal to or less than (comes before on calendar)E4 then I want to pull a specific value from another cell, else 0.

Thanks [img]/board/images/smiles/icon_smile.gif[/img]
Try whether this works:

=(B4+0<=Sheet1!E4+0)*WIE!$F$6


Aladin Akyurek is offline   Reply With Quote
Old Mar 26th, 2002, 10:28 AM   #6
Adrae
Board Regular
 
Join Date: Feb 2002
Location: Chicago, IL USA
Posts: 306
Default

That works beautifully!! Thanks
Adrae is offline   Reply With Quote
Old Mar 26th, 2002, 10:48 AM   #7
Cosmos75
Board Regular
 
Join Date: Feb 2002
Location: Tulsa, OK
Posts: 354
Default

=IF( B4 =< Sheet1!E4 , WIE!$F$6 , 0)

The "=<" means "equals to or less than".

[ This Message was edited by: Cosmos75 on 2002-03-26 10:06 ]
Cosmos75 is offline   Reply With Quote
Old Mar 26th, 2002, 11:17 AM   #8
Adrae
Board Regular
 
Join Date: Feb 2002
Location: Chicago, IL USA
Posts: 306
Default

What about a "between" function. For example:

If E4 is between the dates 1/01/02 and 1/31/02 then value should be "x"

Any thoughts?

Thanks
Adrae is offline   Reply With Quote
Old Mar 26th, 2002, 11:34 AM   #9
Cosmos75
Board Regular
 
Join Date: Feb 2002
Location: Tulsa, OK
Posts: 354
Default

You can do this two ways

put your two reference dates in A1 (01/01/2002) and A2 (01/31/2002) and the cell you are looking at in E3

=IF(AND(E3 < A2 , E3 > A1),"OK","Not in range")

Or figure out the numerical value of the date by formating A1:A2 as numbers and use those number to replace the A2 and A3 in your formula.

In this case 01/01/2002 = 37257 and 01/31/2002 = 37278.

=IF(AND(E3<37287,E3>37257),"OK","Not in range")

Hope this helps.

[ This Message was edited by: Cosmos75 on 2002-03-26 10:34 ]
Cosmos75 is offline   Reply With Quote
Old Mar 26th, 2002, 11:39 AM   #10
davers5
Board Regular
 
Join Date: Feb 2002
Posts: 255
Default

=IF(B4
You're missing a parentheses after the second if, it should be:

=IF(B4
This reads,
If B4 Otherwise If b4=sheet1 e4, then WIE f6
Otherwise 0

You should use a <= in this statement, but it is possible to nest if's you just have to have the write syntax. Here's an example of between:

=IF(A4>=10,IF(A4<=30,"True","False"),"False")
This will print "True" if the number is between 10 and 30 and "False" otherwise.

It works like this:
You can think of it as being If(condition,then, else)
If the condition a4>=10 is true then it goes to the then section and evaluates the next if. If a4<+30 is true it goes to then and returns "True". The then section of the initial if then becomes true and the cell prints true. It it's false, the then condition of the initial if becomes false and it prints "False". If the condition of the intial if is false it goes to the else section and prints "False".

I hope that makes sense and is not too confusing. You can nest up to 7 ifs in this manner.

Dave
davers5 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 04:15 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