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 Apr 18th, 2002, 09:24 AM   #1
kojak43
Board Regular
 
kojak43's Avatar
 
Join Date: Feb 2002
Posts: 270
Default

Yesterday, Adadin provided a neat formula that allowed dates over 90 days old to be counted on my Statistics worksheet. When I test it, it showed 6 jobs that were over 90 days old.
When I went to my DataEntry worksheet I had to search for those dates. I thought, well I have the makings of a conditional formatting formula. All I have to do it change it a little and use it there. So I changed it to read:
=AND($F$1-DATES>=90,STATUS<>"D") I added =today() to $F$1 in DataEntry sheet (Just like I did in Statistics worksheet).
And it just sits there like a lump. I expected if a date was more than 90 Days older than today, and it did not have a "D" in the Status column, it would turn Bold Red. Excel accepts the formula, i.e. it does not say there is an error, it justs does not work.
What have I done wrong?
kojak43 is offline   Reply With Quote
Old Apr 18th, 2002, 09:46 AM   #2
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-04-18 08:24, kojak43 wrote:
Yesterday, Adadin provided a neat formula that allowed dates over 90 days old to be counted on my Statistics worksheet. When I test it, it showed 6 jobs that were over 90 days old.
When I went to my DataEntry worksheet I had to search for those dates. I thought, well I have the makings of a conditional formatting formula. All I have to do it change it a little and use it there. So I changed it to read:
=AND($F$1-DATES>=90,STATUS<>"D") I added =today() to $F$1 in DataEntry sheet (Just like I did in Statistics worksheet).
And it just sits there like a lump. I expected if a date was more than 90 Days older than today, and it did not have a "D" in the Status column, it would turn Bold Red. Excel accepts the formula, i.e. it does not say there is an error, it justs does not work.
What have I done wrong?
AND returns a single logical value and $F$1-DATES is an array result with multiple elements.

Lets say dates are in E fro E3 on and status values in R from R3 on. Select all E-values, choose Formula Is for Condition 1, enter

=AND(TODAY()-E3>=90,R3<>"D")

and choose a formatting you wish.

Aladin
Aladin Akyurek is offline   Reply With Quote
Old Apr 18th, 2002, 09:49 AM   #3
Al Chara
MrExcel MVP
 
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
Default

Make sure you actually selected a format to be used in your conditional format. Plenty of times I have caught myself hitting OK without actually selecting a formula.

Your conditional format worked for me. I assume that DATES and STATUS are named ranges. Make sure that they are setup correctly.

Ok Aladin, I didn't know that he had DATES and STATUS setup as arrays. I took them as single cell ranges.

_________________
Hope this helps.
Kind regards, Al.

[ This Message was edited by: Al Chara on 2002-04-18 08:52 ]
Al Chara is offline   Reply With Quote
Old Apr 18th, 2002, 03:44 PM   #4
kojak43
Board Regular
 
kojak43's Avatar
 
Join Date: Feb 2002
Posts: 270
Default

Quote:
=AND($F$1-DATES>=90,STATUS<>"D") I added =today() to $F$1 in DataEntry sheet What have I done wrong?
AND returns a single logical value and $F$1-DATES is an array result with multiple elements.



Aladin
[/quote]

Thanks. Naturally it worked.
I've read and reread your explaination and thought to have an array I had to enter via Shift,Control,Enter. I thought what was done with Dates and Status was a Named Range. (This is getting harder and harder to understand)and if I used those names, I would not have to write e.g. E3:E2000, I could just say Dates.
I understand that AND returns a single result, i.e. 1 or 0, after two conditions are evaluated. But why does an array, located in a single cell have multiple elements? Or do you mean that Dates is one element from one cell and Status is another element from a different cell? (based on my formula)
No, that is not what you are saying, you are saying $F$1-Dates = Array result with multiple elements. Why is it any easier for excel to understand (TODAY()-E3-90,R3<>"D")?
Would it stumble over =AND(Today()-DATES-90,Status<>"D")?
Does this EVER get easier?
Thanks for all your help.
K

kojak43 is offline   Reply With Quote
Old Apr 18th, 2002, 05:00 PM   #5
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

I've read and reread your explaination and thought to have an array I had to enter via Shift,Control,Enter. I thought what was done with Dates and Status was a Named Range. (This is getting harder and harder to understand)and if I used those names, I would not have to write e.g. E3:E2000, I could just say Dates.
I understand that AND returns a single result, i.e. 1 or 0, after two conditions are evaluated. But why does an array, located in a single cell have multiple elements? Or do you mean that Dates is one element from one cell and Status is another element from a different cell? (based on my formula)
No, that is not what you are saying, you are saying $F$1-Dates = Array result with multiple elements. Why is it any easier for excel to understand (TODAY()-E3-90,R3<>"D")?
Would it stumble over =AND(Today()-DATES-90,Status<>"D")?
Does this EVER get easier?


You might want to have a look at

http://www.mrexcel.com/wwwboard/messages/8961.html

where I describe how SUMPRODUCT works. Its contents apply also to formulas that you enter with control+shift+enter. Consider the formula:

=SUMPRODUCT((TODAY()-DATES>=90)*(STATUS<>"D"))

Activate the cell of this formula, go to the formula bar, select the TODAY()-DATES bit, and hit F9.

You'll see a constant array of differences:

[0]

{107;107;107;107;107;107;68;68;68;68;68;68;53;53;49;49;49;49;30;30;30;30;30;30;30;18;18;18;18;18;18;18;18;18;18;18;8;8;5 3;53;53;49;49;18;18;8;8;8}

Now hit the escape key, select the TODAY()-DATES>=90 and hit F9. You'll see a constant array of logical values:

[1]

{TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE ;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE ;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE}

Select the STATUS<>"D" bit and hit F9. You'll see another constant array of logical values:

[2]

{TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE ;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;FALSE;FAL SE}

Hit escape, select the (TODAY()-DATES>=90)*(STATUS<>"D") bit, and F9. You'll get again a consant array, but this time, of 1's and 0's. Multiplying logical values are re-expressed as binary numbers:

TRUE*TRUE == 1
TRUE*FALSE == 0
FALSE*TRUE == 0
FALSE*FALSE == 0

Hence:

[3]

{1;1;1;1;1;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0}

SUMPRODUCT sums this arrays of 1's and 0's and returns 6.

You can say, non-technically, that SUMPRODUCT or control+shift+enter with array-formulas applies F9 to the arguments.

=AND((TODAY()-DATES>=90),(STATUS<>"D"))

normally entered, will always return the value corresponding to the evaluation of the first elements of [1] and [2], that is:

=AND(TRUE,TRUE) == TRUE

If you array-enter (with control-shift-enter) the above AND-formula, you'll get FALSE as result. A single FALSE anywhere in [1] or [2] is sufficient for AND to return FALSE.

When you use the AND formula in conditional formatting cell by cell, the result for each cell be always be the same: either TRUE or FALSE.

Excel understands the formula thus perfectly, but not the way you thought it ought to understand.

On the other hand,

=AND(TODAY()-E3>=90,R3<>"D")

computes a result for just E3.

The above formula becomes in E4:

=AND(TODAY()-E4>=90,R4<>"D")

and computes a result for just E4.

Hope this helps.

Aladin

[ This Message was edited by: Aladin Akyurek on 2002-04-18 16:10 ]
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 04:46 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