+ Reply to Thread
Results 1 to 19 of 19

Multiple indexing arrays?

Hybrid View

sperrysperry Multiple indexing arrays? 12-15-2013, 04:01 PM
Tony Valko Re: Multiple indexing arrays? 12-15-2013, 04:08 PM
sperrysperry Re: Multiple indexing arrays? 12-15-2013, 04:52 PM
Tony Valko Re: Multiple indexing arrays? 12-15-2013, 05:07 PM
FDibbins Re: Multiple indexing arrays? 12-15-2013, 05:12 PM
sperrysperry Re: Multiple indexing arrays? 12-15-2013, 05:44 PM
Tony Valko Re: Multiple indexing arrays? 12-15-2013, 05:57 PM
Tony Valko Re: Multiple indexing arrays? 12-15-2013, 06:01 PM
sperrysperry Re: Multiple indexing arrays? 12-15-2013, 08:50 PM
Tony Valko Re: Multiple indexing arrays? 12-15-2013, 11:25 PM
sperrysperry Re: Multiple indexing arrays? 12-15-2013, 08:51 PM
FDibbins Re: Multiple indexing arrays? 12-15-2013, 05:53 PM
bebo021999 Re: Multiple indexing arrays? 12-15-2013, 10:37 PM
azumi Re: Multiple indexing arrays? 12-15-2013, 11:39 PM
sperrysperry Re: Multiple indexing arrays? 12-16-2013, 01:03 AM
sperrysperry Re: Multiple indexing arrays? 12-16-2013, 01:16 AM
sperrysperry Re: Multiple indexing arrays? 12-15-2013, 11:41 PM
Tony Valko Re: Multiple indexing arrays? 12-15-2013, 11:53 PM
sperrysperry Re: Multiple indexing arrays? 12-16-2013, 01:10 AM
  1. #1
    Registered User
    Join Date
    10-02-2013
    Location
    Santa Rosa, CA, USA
    MS-Off Ver
    Excel 2010
    Posts
    44

    Multiple indexing arrays?

    I give up. Here is the logic: If cell y2=1, index/match using column AA to index, column Y to match. If cell y2=2, index/match using column AB to index, column Y to match. Here is the formula:

    =IF(Y2=1,INDEX($AA$8:$AA$12,MATCH(Y8,$Y$8:$Y$12,0),IF(Y2=2,INDEX($AB$8:$AB$12,MATCH(Y8,$Y$8:$Y$12,0)))))

    Excel "accepts" the formula. When I type 1 in cell y3, it indexes properly. But when I type 2 in cell y3, I get a FALSE. Am I doing something wrong, or can Excel not do what I'm asking it to do?

    Thanks (again.... you all are batting 1000 solving my problems.)

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Multiple indexing arrays?

    Maybe this...

    =INDEX(IF(Y2=1,$AA$8:$AA$12,$AB$8:$AB$12),MATCH(Y8,$Y$8:$Y$12,0))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    10-02-2013
    Location
    Santa Rosa, CA, USA
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Multiple indexing arrays?

    That works fine for y2=1. I added a coma and duplicated what you have for y2=2, but all I got were excel error messages. (I tried different combinations of "if"'s and "index"'s, to no avail.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Multiple indexing arrays?

    If there are only 2 options for Y2, Y2 = 1 or Y2 = 2, then don't make any changes to the formula.

    Another way to write it would be:

    =INDEX(CHOOSE(Y2,$AA$8:$AA$12,$AB$8:$AB$12),MATCH(Y8,$Y$8:$Y$12,0))

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Multiple indexing arrays?

    Tony's formula...
    =INDEX(IF(Y2=1,$AA$8:$AA$12,$AB$8:$AB$12),MATCH(Y8,$Y$8:$Y$12,0))
    is using Y2=1 to select 1 of 2 very specific ranges...
    y2=1 range is $AA$8:$AA$12
    y2<>1 range is $AB$8:$AB$12

    Just duplicating the formula amd changing Y1 to Y2, without changing anything else, wont give you the answer you want
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Registered User
    Join Date
    10-02-2013
    Location
    Santa Rosa, CA, USA
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Multiple indexing arrays?

    The "index(choose" also works. But... I feel like an idiot. There will be 3 (maybe 4) index's/match's to choose from. Is it still do-able? (I really appreciate this.)

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Multiple indexing arrays?

    Just add the other ranges in sequential order:

    =INDEX(CHOOSE(Y2,range1,range2,range3,range4),MATCH(Y8,$Y$8:$Y$12,0))

    Where Y2 is a number from 1 to 4.

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Multiple indexing arrays?

    Or, if the ranges are all within a contiguous range of cells you can INDEX the entire range and just use Y2 as the column number argument.

    =INDEX($AA$8:$AD$12,MATCH(Y8,$Y$8:$Y$12,0),Y2)

  9. #9
    Registered User
    Join Date
    10-02-2013
    Location
    Santa Rosa, CA, USA
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Multiple indexing arrays?

    I could only get the equations to work in one dimension. I'm sure the problem lies in my description of what I need. Here is a better way to explain what I am looking for:
    A B C D E
    $ to invest Short Medium Long Very long
    1 10000 100 21 95 108
    2 5000 25 77 50 36
    3 2500 88 39 12 44
    4 1000 38 99 0 3
    5 500 50 25 0 2

    IF a client has $5000 to invest short term, I send them flyer #25. If they have $1000 to invest very long term, I send them flyer #3. I know how much they have to invest, they tell me how long they want to invest for, and I want Excel to tell me what flyer to send them. Is that just a Vlookup problem?

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Multiple indexing arrays?

    Are those the only amounts to invest? Can someone invest 7500 short term?

    If so, what result would you expect?

  11. #11
    Registered User
    Join Date
    10-02-2013
    Location
    Santa Rosa, CA, USA
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Multiple indexing arrays?

    Sorry... spacing didn't work. Hopeless.

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Multiple indexing arrays?

    It looks like Tony is off-line.

    with his formula (he is really awesome with his formulas!!),,,
    =INDEX(CHOOSE(Y2,$AA$8:$AA$12,$AB$8:$AB$12),MATCH(Y8,$Y$8:$Y$12,0))

    if you have extra options to choose from, you could add them inside the CHOOSE()...
    CHOOSE(Y2,$AA$8:$AA$12,$AB$8:$AB$12,$AC$8:$AC$12$AD$8:$AD$12)
    But maybe you need to look at other options (maybe offset()) if you have that many options to choose from

    edit: ok, so he came back
    Last edited by FDibbins; 12-15-2013 at 06:01 PM.

  13. #13
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,656

    Re: Multiple indexing arrays?

    Assuming F1= given amount, F2=given term
    flyer # should be:
    =INDEX($A$1:$E$5,MATCH($F$1,$A$1:$A$5,0),MATCH($F$2,$A$1:$E$1,0))
    or
    =VLOOKUP($F$1,$A$1:$E$5,MATCH($F$2,$A$1:$E$1,0),0)
    Quang PT

  14. #14
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 365
    Posts
    2,406

    Re: Multiple indexing arrays?

    Maybe you have sample workbook? or just see my file for example and tell me if meet your goal..
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    10-02-2013
    Location
    Santa Rosa, CA, USA
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Multiple indexing arrays?

    I KNEW I wasn't crazy. My approach (see first entry in this thread) was 100% valid. You used the same approach. When I looked closely at your equation, I noticed that you had TWO close parenthesis after the first "if," clause and 4 at the end of the equation. My original equation had ONE at the end of the first "if" clause and FIVE at the end of the equation. I changed it to the way your equation looked, and mine WORKED!!!

  16. #16
    Registered User
    Join Date
    10-02-2013
    Location
    Santa Rosa, CA, USA
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Multiple indexing arrays?

    I responded to this... but it got put at the end of the thread. Just wanted to make sure you knew that I REALLY appreciated your response.

  17. #17
    Registered User
    Join Date
    10-02-2013
    Location
    Santa Rosa, CA, USA
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Multiple indexing arrays?

    That was intense. First, thanks to all of you. Every formula I got was what I asked for. I just didn't ask right. In the process of figuring out what I needed, I discovered that what I wanted to do would take about 2000 man hours to set up. And I'm not quite that enthusiastic about this project. So... I'll do the quickie workaround. Plan B it is. Thanks again. (Tony... I don't really have any investment flyers... but you probably know that... I am trying to figure out a system to award points in tennis matches... but ... given how I slaughtered my explanations with a simple example... I can only imagine what would have happened if I would have tried to explain the whole tennis thing.....) Anyway... I'll tab this solved and star everyone who helped.

  18. #18
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Multiple indexing arrays?

    Good deal. Thanks for the feedback!

  19. #19
    Registered User
    Join Date
    10-02-2013
    Location
    Santa Rosa, CA, USA
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Multiple indexing arrays?

    Just an FYI.... Azumi sent me an example of an equation she used. She used the same approach as I did on the very first post on this thread. Drove me crazy... why did hers work and mine not? I did: IF(Y2=1,INDEX($AA$8:$AA$12,MATCH(Y8,$Y$8:$Y$12,0),IF(Y2=2,INDEX($AB$8:$AB$12,MATCH(Y8,$Y$8:$Y$12,0))))) Note: One close parenthesis before the second "if," and five at the end of the equation. She had two and four. I changed mine to 2 and 4, and, wha-la... perfecto. (Breaking my hand patting myself on the back.) (I'm STILL not going to use the damned thing... but at least I got it to work.)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Indexing multiple arrays
    By Kybynn in forum Excel General
    Replies: 6
    Last Post: 05-28-2012, 10:32 PM
  2. [SOLVED] Indexing problem using multiple arrays and conditions
    By Kybynn in forum Excel General
    Replies: 2
    Last Post: 04-23-2012, 04:19 AM
  3. [SOLVED] Matching and Indexing Multiple Columns
    By tim220225 in forum Excel General
    Replies: 10
    Last Post: 03-29-2012, 07:26 AM
  4. Indexing Multiple Tables
    By Haywire79 in forum Excel General
    Replies: 6
    Last Post: 08-13-2010, 02:12 AM
  5. Indexing and matching multiple criteria
    By Dbeethekidd in forum Excel General
    Replies: 8
    Last Post: 09-02-2009, 08:22 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1