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 2nd, 2002, 08:50 AM   #1
huskylord
New Member
 
Join Date: Apr 2002
Posts: 7
Default

Hello to all,

First time poster here so I hope I don't inadverdantly break any taboos around here.

My question involves a simple arrary. Let's say that cell C5 has the arrary {5,6,8,4}.
Now lets say that I am on cell H5 and I need to extract the 2nd value from the known arrary on C5. I believe that the Index function is what's necessary. According to the Index function, 3 arguments are required, the array, the row number and the column number. Is it possible to specify a cell value that has a current array within as the array arguement for the Index function? Am i completely approaching this wrong? Please let me know if i've confused everyone here as much myself.

thank you


[ This Message was edited by: huskylord on 2002-04-02 07:52 ]
huskylord is offline   Reply With Quote
Old Apr 2nd, 2002, 09:16 AM   #2
Al Chara
MrExcel MVP
 
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
Default

Try the MID function:

=MID(C5,3,1)

__________________
Kind regards,

Al Chara
Al Chara is offline   Reply With Quote
Old Apr 2nd, 2002, 09:21 AM   #3
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Does C5 contain the text string, "{5,6,8,4}", or the formula (array constant), ={5,6,8,4}?

BTW, =INDEX({5,6,8,4},1,2), returns 6.

[ This Message was edited by: Mark W. on 2002-04-02 08:25 ]
Mark W. is offline   Reply With Quote
Old Apr 2nd, 2002, 09:59 AM   #4
huskylord
New Member
 
Join Date: Apr 2002
Posts: 7
Default

"BTW, =INDEX({5,6,8,4},1,2), returns 6."

Thank you for the responses. I've tried the above statement, but that requires the whole array to be included within the formula. Tell me if i'm just looking for the slacker solution, but I was hoping I could take the same array, place it in any particular cell, (example C5, and from a different cell location, identify a particular number within the array.
In essence, is this possible =>
Index(C5,1,2) where C5 is an array.

Once again, thank you
huskylord is offline   Reply With Quote
Old Apr 2nd, 2002, 10:11 AM   #5
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Quote:
In essence, is this possible =>
Index(C5,1,2) where C5 is an array.
Not if C5 contains "{5,6,8,4}". Even if C5 contained the array constant, ={5,6,8,4}, =INDEX(C5,1,2), wouldn't return 6 because a single cell can only hold one value of the array -- in this case the 1st value -- 5.

In fact, =INDEX(C5,1,2), would return a #REF! error since as a single cell C5 doesn't have 2 columns.

[ This Message was edited by: Mark W. on 2002-04-02 09:17 ]
Mark W. is offline   Reply With Quote
Old Apr 2nd, 2002, 10:32 AM   #6
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

You could use =INDEX(My_Array,1,2) to return 6 where My_Array is a defined name that refers to ={5,6,8,4}.
Mark W. is offline   Reply With Quote
Old Apr 2nd, 2002, 11:35 AM   #7
huskylord
New Member
 
Join Date: Apr 2002
Posts: 7
Default

Just tried out your suggestion and the only valid number that comes back is the for the first value in the array...any other reference comes back as an error.

[ This Message was edited by: huskylord on 2002-04-02 10:36 ]
huskylord is offline   Reply With Quote
Old Apr 2nd, 2002, 12:33 PM   #8
Albert 1
Board Regular
 
Join Date: Feb 2002
Posts: 390
Default

=CHOOSE(A1,MID(C5,1,1),MID(C5,3,1),MID(C5,5,1),MID(C5,7,1))
(A1=1, 2, 3, or 4)
Albert 1 is offline   Reply With Quote
Old Apr 2nd, 2002, 12:33 PM   #9
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
Default

Quote:
On 2002-04-02 10:35, huskylord wrote:
Just tried out your suggestion and the only valid number that comes back is the for the first value in the array...any other reference comes back as an error.

[ This Message was edited by: huskylord on 2002-04-02 10:36 ]
A defined name requires that you

activate the option Insert|Name|Define,
enter My_Array as name in the Names in Workbook box,
and enter as formula in the Refers to box:

={5,6,8,4}

INDEX can then be applied to My_Array, as Mark suggested.

Aladin Akyurek is offline   Reply With Quote
Old Apr 2nd, 2002, 01:56 PM   #10
huskylord
New Member
 
Join Date: Apr 2002
Posts: 7
Default

Quote:
On 2002-04-02 11:33, Aladin Akyurek wrote:
Quote:
On 2002-04-02 10:35, huskylord wrote:
Just tried out your suggestion and the only valid number that comes back is the for the first value in the array...any other reference comes back as an error.

[ This Message was edited by: huskylord on 2002-04-02 10:36 ]
A defined name requires that you

activate the option Insert|Name|Define,
enter My_Array as name in the Names in Workbook box,
and enter as formula in the Refers to box:

={5,6,8,4}

INDEX can then be applied to My_Array, as Mark suggested.


Tried it and...it works!!!!

Thank you all very much...
huskylord 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:56 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