+ Reply to Thread
Results 1 to 20 of 20

index match - using indirect and automating the Columns

  1. #1
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    index match - using indirect and automating the Columns

    the spreadsheet is very large -so example not loaded - if necessary, i can try setting up an example
    =INDEX(INDIRECT("'"&$C10&"'!AI:AI"),MATCH(D$8,INDIRECT("'"&$C10&"'!AA:AA"),0))
    variations of this is in 52 rows and about 30 columns - so hence the question , as any modification on sheet2 which is referenced by C10 (actually 52 different sheets) reference, is not reflected in the formula columns

    this formula or version is used in a large spreadsheet - which looks up values

    on the sheet1 (summary)

    in column C , I have all the names of the sheets (actually product codes)
    in the example sheet2
    then in cell D8 , i have a week number to lookup

    in the product sheet , i have a weekly entry - so i have the week numbers in a column and results in other columns

    so the above formula

    will return the result as follows

    =INDEX(INDIRECT("'"&$C10&"'!AI:AI"),MATCH(D$8,INDIRECT("'"&$C10&"'!AA:AA"),0))

    returns the value in column AI for the sheet name in C10
    and then looks up the week number from sheet1 D8 and matches with the column of week numbers on sheet 2 column AA

    all works great

    NOW the issue

    if i insert a column into the sheet2 , everything moves along
    so
    AI becomes AJ
    and
    AA becomes AB

    BUT because the values in the indirect formula are hardcoded , they do not change and so i get errors

    how can i modify the indirect formula , so its relative addressing sheet2 and not hardcoded , therefore any changes to the columns in sheet2 - will be modified on the sheet 1 indirect formula

    thanks
    Last edited by etaf; 01-19-2014 at 09:05 AM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: index match - using indirect and automating the Columns

    well you could replace the hard AA:AA with
    =ADDRESS(1,COLUMN(AA1),,1)&":"&ADDRESS(10000,COLUMN(AA1),,1)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: index match - using indirect and automating the Columns

    thanks for the quick reply

    =INDEX(INDIRECT("'"&$C10&"'!AC:AC"),MATCH(D$8,INDIRECT("'"&$C11&"'!"&ADDRESS(1,COLUMN(AA1),,1)&":"&ADDRESS(10000,COLUMN(AA1),,1)),0))

    didnt like that in the formula

    i assume thats what you meant ?

    edit - update
    got it working now

    so I assume I need the same for AC

    =INDEX(INDIRECT("'"&$C10&"'!"&ADDRESS(1,COLUMN(AC1),,1)&":"&ADDRESS(10000,COLUMN(AC1),,1)),MATCH(D$8,INDIRECT("'"&$C11&"'!"&ADDRESS(1,COLUMN(AA1),,1)&":"&ADDRESS(10000,COLUMN(AA1),,1)),0))

    but that does not work , when I insert a column or two into column R and so move the AC across
    it still picks up the column AC
    Last edited by etaf; 01-19-2014 at 09:53 AM.

  4. #4
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: index match - using indirect and automating the Columns

    hi etaf. do you have a header in the other sheets that identify AA is the column you should be looking at? maybe you should do a MATCH formula to find that column.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: index match - using indirect and automating the Columns

    that would be far easier! even if you havent got a column header at the moment you could add one

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: index match - using indirect and automating the Columns

    thats an idea

    yes all the headers are in row 9

    and so we have the same title on sheet1 row9
    as we do in sheet 2 row 9

    so the headers are
    target
    Processed
    delivered
    stock
    etc

    and so in the sheet1 column I want to pull across the target column in sheet2 , from an area after AA
    I do also have those titles in sheet2 in columns D,E,F,G etc, where data entry is carried out
    so it needs tolook after column AA - or I need to think about hiding the headers somehow - or font colour maybe to change
    like for d,e,f,g add a1
    target1
    delivered1
    stock1
    maybe


    how would I code for the header names
    Last edited by etaf; 01-19-2014 at 10:06 AM.

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: index match - using indirect and automating the Columns

    mind you
    =INDEX(INDIRECT("'"&$C10&"'!"&ADDRESS(1,COLUMN(AC1),,1)&":"&ADDRESS(10000,COLUMN(AC1),,1)),MATCH(D$8,INDIRECT("'"&$C10&"'!"&ADDRESS(1,COLUMN(AA1),,1)&":"&ADDRESS(10000,COLUMN(AA1),,1)),0))
    when i insert say 2 new columns at column R
    changes to
    =INDEX(INDIRECT("'"&$C10&"'!"&ADDRESS(1,COLUMN(AE1),,1)&":"&ADDRESS(10000,COLUMN(AE1),,1)),MATCH(D$8,INDIRECT("'"&$C10&"'!"&ADDRESS(1,COLUMN(AC1),,1)&":"&ADDRESS(10000,COLUMN(AC1),,1)),0))

  8. #8
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: index match - using indirect and automating the Columns

    that does change if the columns are changed on sheet 1 where the formula is
    BUT is the other sheet thats also changing

    if i repace C10 with the sheet name - if that helps

    The formula is in sheet1 as follows
    =INDEX(INDIRECT("'"&$SHEET2&"'!AI:AI"),MATCH(D$8,INDIRECT("'"&$SHEET2&"'!AA:AA"),0))

    i know the formula is wrong now - but for illustration

    the reference is
    sheet2!AI:AI

    now if i insert a couple of columns in sheet 2 column R say

    it needs to refer to
    sheet2!AK:AK

    the suggestion does not change

    if i change sheet1 the address changes
    not if i change sheet2

    thanks for helping

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: index match - using indirect and automating the Columns

    yep i see its coz im testing all on one sheet doh!

  10. #10
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: index match - using indirect and automating the Columns

    thanks

    I basically would like to delete columns or add columns in any sheet1 or sheet2
    and the reference move - like it would if you had simply

    =sheet2!A3

  11. #11
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: index match - using indirect and automating the Columns

    ok attempt number ??????
    uses index with indirect
    looks for the headers in row 9 aa:bb of sheet name in cell c10
    Attached Files Attached Files

  12. #12
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: index match - using indirect and automating the Columns

    didnt seem to work

    I have made a sample

    summary , i would like to add columns and the code change

    shee2 or sheet3
    again add or delete columns and the code on summary stay correct

    for example in summary be able to delete columns I and J
    in Sheet2
    add a column to after G

    i dont think there is anything about the company in the sheets
    can you remove if there is and i will modify

    thanks
    Attached Files Attached Files

  13. #13
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: index match - using indirect and automating the Columns

    In pub so wont be sober enough

  14. #14
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: index match - using indirect and automating the Columns

    no urgency, thanks for looking

  15. #15
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: index match - using indirect and automating the Columns

    why are you using
    01/01/1900?

  16. #16
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: index match - using indirect and automating the Columns

    i'm not- its probably where i changed things in creating a summary - should probably be 1 or 5 -
    but those titles exist in the other sheet and ALL Titles will be TEXT

  17. #17
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: index match - using indirect and automating the Columns

    p8
    =IF(D8=1,#REF!,D8-1)

  18. #18
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: index match - using indirect and automating the Columns

    where I have deleted some things
    should be
    =IF(D8=1,"",D8-1)

  19. #19
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: index match - using indirect and automating the Columns

    well you need some consistency in headers so i have changed a couple but maybe you should consider how this is laid out
    but ive added the formula below the curent one you have to show how it works
    Attached Files Attached Files
    Last edited by martindwilson; 01-19-2014 at 05:24 PM.

  20. #20
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: index match - using indirect and automating the Columns

    Thanks, only just picked up this reply, sorry for the delay,
    I will remove over the next few days and see how it works,

+ 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. Index? Indirect? Match?
    By CpnVenice in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-13-2013, 02:43 PM
  2. Problem with INDEX, INDIRECT, MATCH, MATCH
    By JO505 in forum Excel General
    Replies: 5
    Last Post: 09-01-2011, 05:51 PM
  3. need help automating large and index/match??
    By TechRetard in forum Excel General
    Replies: 4
    Last Post: 03-02-2011, 04:26 AM
  4. Using INDEX/MATCH with indirect
    By jdpjtp910 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-15-2010, 11:39 AM
  5. Index, Indirect, Match
    By ruslan_adx in forum Excel General
    Replies: 1
    Last Post: 10-08-2009, 03:35 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