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 11th, 2002, 02:26 PM   #1
Waxaholic
Board Regular
 
Join Date: Apr 2002
Posts: 68
Default

Surely this is possible but i am lost. I have tried a few different ways to accomplish this but run into the "Formula is too long" scenario. Here is what i am trying to do:

A1:A16 contains the data. I want to be able to compare each cell within the range to all of the other cells within the same range for a difference of <.630 . For example, compare A1 to A2--A16, A2 to A1--A16, and so on. If the difference is encountered then some sort of flag would be raised whether it be cell formatting or a return value of TRUE/FALSE to an adjacent cell. Any help appreciated.

Waxaholic

[ This Message was edited by: Waxaholic on 2002-04-11 13:28 ]
Waxaholic is offline   Reply With Quote
Old Apr 11th, 2002, 02:43 PM   #2
Andy Gee
New Member
 
Join Date: Feb 2002
Posts: 48
Default

You can send the sheet or mockup sheet for me to have a look at if you like?
andy.gee@blueyonder.co.uk
Andy Gee is offline   Reply With Quote
Old Apr 11th, 2002, 03:46 PM   #3
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Enter the array formula...

{=OR(ABS(A1-IF(ROW($A$1:$A$16)<>ROW(A1),$A$1:$A$16))<0.63)}

...into B1 and copy down. Array formulas must be entered using the Control+Shift+Enter key combination. For more on array formulas see the Excel Help topic for "About array formulas and how to enter them".
Mark W. is offline   Reply With Quote
Old Apr 11th, 2002, 09:32 PM   #4
Waxaholic
Board Regular
 
Join Date: Apr 2002
Posts: 68
Default

Ok, the formula above works fine for the A1 to A1:A16 comparisons. A2 to A1:A16 comparisons don't work at all. They just return the value for the A1 to A1:A16 comparison. Regardless of what i do they contine to return values based on A1. I created a failure for the A1 comparison and it worked fine. I then created a failure for the A2 comparison and it doesn't work. Any ideas? Thanks.

Waxaholic
Waxaholic is offline   Reply With Quote
Old Apr 11th, 2002, 11:06 PM   #5
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
Default

Quote:
On 2002-04-11 20:32, Waxaholic wrote:
Ok, the formula above works fine for the A1 to A1:A16 comparisons. A2 to A1:A16 comparisons don't work at all. They just return the value for the A1 to A1:A16 comparison. Regardless of what i do they contine to return values based on A1. I created a failure for the A1 comparison and it worked fine. I then created a failure for the A2 comparison and it doesn't work. Any ideas? Thanks.

Waxaholic
Enter this in a cell

=((ABS(A1:A16-TRANSPOSE(A1:A16)))<0.630)+0

Activate the cell of the formula, select a range of 16 by 16 while in this cell, and hit control+shift+enter. You'll get a matrix of 1 and/or 0's. Not sure though whether it gives what you want.
Aladin Akyurek is offline   Reply With Quote
Old Apr 15th, 2002, 10:04 AM   #6
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Quote:
On 2002-04-11 20:32, Waxaholic wrote:
Ok, the formula above works fine for the A1 to A1:A16 comparisons. A2 to A1:A16 comparisons don't work at all. They just return the value for the A1 to A1:A16 comparison. Regardless of what i do they contine to return values based on A1. I created a failure for the A1 comparison and it worked fine. I then created a failure for the A2 comparison and it doesn't work. Any ideas? Thanks.

Waxaholic
Provide some representative sample data and the expected results!

[ This Message was edited by: Mark W. on 2002-04-15 15:00 ]
Mark W. is offline   Reply With Quote
Old Apr 15th, 2002, 10:55 AM   #7
eliW
Board Regular
 
eliW's Avatar
 
Join Date: Mar 2002
Posts: 1,805
Default

Hi Aladin,
I made a simple model of 5x5 cells and it does not seem to work. Probably I do not understand your instructions:

Quote:

Enter this in a cell
=((ABS(A1:A16-TRANSPOSE(A1:A16)))<0.630)+0
Is this in any cell?

Quote:

Activate the cell of the formula, select a range of 16 by 16 while in this cell, and hit control+shift+enter. You'll get a matrix of 1 and/or 0's. Not sure though whether it gives what you want.
How can I activate this cell and in the same time select another range of cells? Is it by pressing ALT ? Any way it is not working.

Thanks in advance

Eli


[ This Message was edited by: eliW on 2002-04-15 09:56 ]
eliW is offline   Reply With Quote
Old Apr 15th, 2002, 11:51 AM   #8
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
Default


On 2002-04-15 09:55, eliW wrote:
Hi Aladin,
I made a simple model of 5x5 cells and it does not seem to work. Probably I do not understand your instructions:


Quote:

Enter this in a cell
=((ABS(A1:A16-TRANSPOSE(A1:A16)))<0.630)+0
Is this in any cell?

Yes, a cell outside the data range.

Quote:

Activate the cell of the formula, select a range of 16 by 16 while in this cell, and hit control+shift+enter. You'll get a matrix of 1 and/or 0's. Not sure though whether it gives what you want.
How can I activate this cell and in the same time select another range of cells? Is it by pressing ALT ? Any way it is not working.

[ This Message was edited by: eliW on 2002-04-15 09:56 ]


Eli,

You just type the formula in the activated/selected cell and hit enter. You'll get a #VALUE! error. Now select an area 16 by 16, starting from this formula cell and hit control+shift+enter to get the matrix of results I mentioned.

I must say that, as I noted, I'm not sure whether this meets the specs. Mark is already asking for more info.

Aladin


[ This Message was edited by: Aladin Akyurek on 2002-04-15 10:52 ]
Aladin Akyurek is offline   Reply With Quote
Old Apr 16th, 2002, 08:12 AM   #9
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Quote:
On 2002-04-11 20:32, Waxaholic wrote:
Ok, the formula above works fine for the A1 to A1:A16 comparisons. A2 to A1:A16 comparisons don't work at all. They just return the value for the A1 to A1:A16 comparison. Regardless of what i do they contine to return values based on A1. I created a failure for the A1 comparison and it worked fine. I then created a failure for the A2 comparison and it doesn't work. Any ideas? Thanks.

Waxaholic
Perhaps this "tweak" will suffice...

{=OR(ABS(A1-IF(ROW($A$1:$A$16)<>ROW(A1),$A$1:$A$16,A1+0.63))<0.63)}

If A1:A16 contains...

{0.1;0.9;2;1.6;3;4;5;6;6.4;8;9;10;11;12;13;14}

...and, this array formula is entered into B1 and copied down to B16 it'll produce...

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

B3 and B4 are TRUE because |2-1.6| < 0.63.
B8 and B9 are TRUE because |6-6.4| < 0.63.

All other values in column have an absolute difference greater than 0.63.

BTW, the formula insures that when a value is compared to itself it will NEVER return TRUE; otherwise, the results for the entire list would always be TRUE.

Your problem statement suggested that A1 should be compared to A2:A16 and A2 should be compared to A1:A16. In fact, A1 should be compared to A2:A16, A2 should be compared to A1,A3:A16, etc.

[ This Message was edited by: Mark W. on 2002-04-16 07:16 ]
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 07:01 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