+ Reply to Thread
Results 1 to 31 of 31

Instead of INDIRECT() need to have INDEX and MATCH

Hybrid View

  1. #1
    Registered User
    Join Date
    03-01-2017
    Location
    germany
    MS-Off Ver
    2013
    Posts
    12

    Smile Instead of INDIRECT() need to have INDEX and MATCH

    Hello,
    Can you help me
    I do not want to use INDIRECT (). I want to use INDEX and MATCH.But i do not know how.
    There is a link between bills.xlsx and evaluation.xlsx.
    I need to manually change the matrix area in the file evaluation.xlsx (MatrixArea) monthly.
    In the file Evaluations.xlsx I have to have the following results in the cells: cell C12 = 5, cell C13 = 7, cell C14 = 2 when I type in MatrixArea (A4 and D6)
    In the file evaluation.xlsx, I have to get the following results in the cells: cell C12 = 2, cell C13 = 3, cell C14 = 9 when I type in MatrixArea (A11 and D13)

    Config:
    C12= VLOOKUP($A12;INDIRECT("'[bills.xlsx]2016'!"&MatrixArea!C6&":"&MatrixArea!D6&"");4;0)
    C13= VLOOKUP($A13;INDIRECT("'[bills.xlsx]2016'!"&MatrixArea!C6&":"&MatrixArea!D6&"");4;0)
    C14=VLOOKUP($A14;INDIRECT("'[bills.xlsx]2016'!"&MatrixArea!C6&":"&MatrixArea!D6&"");4;0)

    bills.JPGevaluation MatrixArea.JPGevaulation -report.xlsx.JPG


    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    08-06-2013
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2013
    Posts
    671

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    Try this:
    Formula: copy to clipboard
    =INDEX('2016'!$D$4:$D$6,MATCH(A12,'2016'!$A$4:$A$6,0))
    1. Include a sample workbook with an example of the result you want
    2. Use [CODE] and [FORMULA] wrappers for your VBA code or excel formulas
    3. If your question has been answered, mark the thread as SOLVED and click on the "Add Rep" star to thank whoever helped you.

  3. #3
    Registered User
    Join Date
    03-01-2017
    Location
    germany
    MS-Off Ver
    2013
    Posts
    12

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    Unfortunately does not work.
    There are two files bills.xlsx and evaluation.xlsx
    The file bills.xlsx has a worksheet '2016'
    The file evaluation.xlsx has two worksheets 'report' and 'MatrixArea'
    In the Matrix area worksheet, I always want to specify the range manually on 'MatrixArea'. Corresponding to the entered matrix area, the counts should be transferred to the Worksheet 'report'

    Thanks

  4. #4
    Valued Forum Contributor
    Join Date
    08-06-2013
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2013
    Posts
    671

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    INDIRECT is the function that interprets ranges entered into cells. Your options are:
    1. Give up on typing in the range and instead make it be somewhere predictable, or enter it into the formula instead of the cells.
    2. Continue to use indirect and you have to keep all workbooks open for it to work.
    3. Write a macro to do what you want.

  5. #5
    Registered User
    Join Date
    03-01-2017
    Location
    germany
    MS-Off Ver
    2013
    Posts
    12

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    Thanks a lot

    I can not fully understand point 1. Can u tell me more about point 1.
    I need to keep the files closed.
    In the function of always changing the area it is a lot of work. For this reason I wanted to enter the matrix area dynamically in the worksheet 'MatrixArea'

  6. #6
    Valued Forum Contributor
    Join Date
    08-06-2013
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2013
    Posts
    671

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    Option 1 means this:
    First, if you can predict where the data will be (ie if it is always in the same columns, if it is moved over a x cells every month, etc) then you can write a formula to look at that range where you know the data will be.
    Second, if you can't predict this, you'll notice that I have ranges typed into my formula. You can manually edit the formula to have the correct range the same way you would edit the "MatrixArea" cells.

  7. #7
    Registered User
    Join Date
    03-01-2017
    Location
    germany
    MS-Off Ver
    2013
    Posts
    12

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    I can not try it. because i get directly Error, when i try to paste the fuctions
    =INDEX('MatrixArea'!$D$4:$D$6,MATCH(A12,'MatrixArea'!$A$4:$A$6,0)) in report!C12
    or
    =INDEX('2016'!$D$4:$D$6,MATCH(A12,'2016'!$A$4:$A$6,0)) in MatrixArea A4 or A6

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    Are you open to changing your method of determining the table?
    It would be easier if you could just put the Month Name in a cell (instead of Cell Names).
    Then we could use that month name to locate the table.

    Is each table always equal in size?

    Can you attach an actual book instead of pictures?

  9. #9
    Registered User
    Join Date
    03-01-2017
    Location
    germany
    MS-Off Ver
    2013
    Posts
    12

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    i try something
    =INDEX('bills.xlsx]2016'!D4:D6;MATCH(A12;'bills.xlsx]2016'!A4:A6;0))
    But in the next step I have to read out the matrix area from the matrix MatrixArea
    So instead of D4: D6 I must then from the Worksheet MatrixArea! C6: D6, so I can always change this myself dynamically.
    I Would be assigned to the sheet MatrixArea so that the matrix area is read out from the sheet matrix area.

    Is that possible?
    Thanks

  10. #10
    Valued Forum Contributor
    Join Date
    08-06-2013
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2013
    Posts
    671

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    I'm having trouble fully understanding your question, but the answer is this:
    The only ways to interpret text as a range are INDIRECT and VBA.
    Otherwise, you have to know where the data will be ahead of time or edit the formula directly.

    Let me try offering one other solution. The only reason I can think why you wouldn't edit the formulas directly is that you don't have access to edit that sheet, but you can get 1-time access to set the formulas. If that is the case, you can simply direct those formulas to look at your own table on your sheet, and then put the formula I gave you there.

    For example:
    In report!C12:
    Formula: copy to clipboard
    =INDEX('MatrixArea'!$D$4:$D$6,MATCH(A12,'MatrixArea'!$A$4:$A$6,0))

    and then in MatrixArea A4: "Onion" and in MatrixArea A6:
    Formula: copy to clipboard
    =INDEX('2016'!$D$4:$D$6,MATCH(A12,'2016'!$A$4:$A$6,0))

  11. #11
    Registered User
    Join Date
    03-01-2017
    Location
    germany
    MS-Off Ver
    2013
    Posts
    12

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    I must keep the structure. I can not change that
    I tried to attach the date but it is not possible
    The admin has to allow me this.

    Thanks

  12. #12
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    If you can't change the structure, then you can't change the formula.
    INDIRECT is absolutely the only way to reference a range by typing it into a cell.
    There is no other function (besides VBA) that can use the A4 and D6 written into those cells to create the range A4:D6

    Can it be assumed that it is ALWAYS column A and D in those 2 cells?
    i.e. we only really need to use the Row #s ?

  13. #13
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    INDIRECT is the only way.
    I was thinking we could use the just the row #s if we can assume it's always column A and D.
    But every method I've tried uses some function(s) that don't work on closed books.
    I can't think of any method that works on closed books.

    There is an Addin Called MoreFunc that has a similar indirect function that works on closed books.
    Search Google for it, you'll probably have to sort through alot of junk and popups to find it.

  14. #14
    Registered User
    Join Date
    03-01-2017
    Location
    germany
    MS-Off Ver
    2013
    Posts
    12

    Question INDEX only works with open file

    Hi,

    =INDEX(INDEX('[bills.xlsx]2016'!$D:$D;MatirxArea!$C$6):INDEX('[bills.xlsx]2016'!$D:$D;MatirxArea!$D$6);MATCH(A12;INDEX('[bills.xlsx]2016'!$A:$A;MatirxArea!$C$6):INDEX('[bills.xlsx]2016'!$A:$A;MatirxArea!$D$6);0))

    The file bills.xlsx must be open. I would like to use the function with closed file ()bills.xlsx.
    Do you have an idea?

  15. #15
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: INDEX only works with open file

    Does it work OK when bills.xlsx is open?? the reason I ask is that Matrix is incorrectly spelled in your formula... just in case...

    However, IM does work on closed sheets. Try changing from whole column references to actual references.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  16. #16
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: INDEX only works with open file

    You need full path to the file. But that should automatically update after you close the referenced workbook.

    Ex: 'C:\Myfolder\Data\[bills.xlsx]2016'!$D:$D

  17. #17
    Registered User
    Join Date
    03-01-2017
    Location
    germany
    MS-Off Ver
    2013
    Posts
    12

    Re: INDEX only works with open file

    I tried. It still does not work.

    Thanks

  18. #18
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: INDEX only works with open file

    It does work on closed sheets.

    Download both files to the same location.

    Open Book 2. Alter the path in the formula in B2 to suit the path on your PC, as needed. This is how it appeared when it left here.


    =IFERROR(INDEX('C:\Users\Windows 8\Desktop\[Book1.xlsx]Sheet1'!B$2:B$7,MATCH(A2,'C:\Users\Windows 8\Desktop\[Book1.xlsx]Sheet1'!$A$2:$A$7,0)),"")
    Attached Files Attached Files

  19. #19
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: INDEX only works with open file

    Duplicate
    https://www.excelforum.com/excel-for...and-match.html

    The issue is not if index(match works on a closed book. Because it does.
    The problem is the syntax of
    INDEX(...):INDEX(...)

    That specific setup does NOT work on closed books.

  20. #20
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: INDEX only works with open file

    Great!! More duplicate threads.. You will need some VBA, as INDIRECT also will not work with closed sheets.

  21. #21
    Valued Forum Contributor
    Join Date
    08-06-2013
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2013
    Posts
    671

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    I don't know if I'll have the time to answer any more, but as a tip, you will get more responses if you upload a sample workbook and specify exactly what you can and can't do, with an example of what you want.

  22. #22
    Registered User
    Join Date
    03-01-2017
    Location
    germany
    MS-Off Ver
    2013
    Posts
    12

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    i can't upload the file. Admin does not allow this.

  23. #23
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    Can you email files?

  24. #24
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,780

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    Michael - I have merged your two threads. Please do NOT open duplicate threads on the same issue in future. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  25. #25
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    One possibility... assuming you can change your data layout slightly.

    =INDEX('C:\Users\Windows 8\Desktop\[bills.xlsx]2016'!$E$3:$E$30,MATCH(1,('C:\Users\Windows 8\Desktop\[bills.xlsx]2016'!A$3:A$30=$B$10)*('C:\Users\Windows 8\Desktop\[bills.xlsx]2016'!B$3:B$30=A12),0))

    This array formula works OK on closed sheets.

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...

    Download both files to the same location and it should work fine...
    Attached Files Attached Files

  26. #26
    Registered User
    Join Date
    03-01-2017
    Location
    germany
    MS-Off Ver
    2013
    Posts
    12

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    How did you make the list of months, so you can always select the current month from worksheets Months?

  27. #27
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    I used a Named Range. (CTRL-F3 to view the wasy it was set up. I then used Data validation to restrict entries ONLY to the named range.

  28. #28
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    Does the formula do what you need?

  29. #29
    Registered User
    Join Date
    03-01-2017
    Location
    germany
    MS-Off Ver
    2013
    Posts
    12

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    Thank you very much

    it's perfect

  30. #30
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Instead of INDIRECT() need to have INDEX and MATCH

    Glad to have helped.

+ 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] sum using indirect index match
    By jpbisani in forum Excel General
    Replies: 4
    Last Post: 04-23-2016, 02:29 PM
  2. [SOLVED] Index - match - indirect
    By JAYZE in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-30-2016, 12:09 PM
  3. Index? Indirect? Match?
    By CpnVenice in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-13-2013, 02:43 PM
  4. Problem with INDEX, INDIRECT, MATCH, MATCH
    By JO505 in forum Excel General
    Replies: 5
    Last Post: 09-01-2011, 05:51 PM
  5. Index/Indirect/Match Help
    By robertsclark in forum Excel General
    Replies: 2
    Last Post: 04-20-2011, 10:24 AM
  6. Index, Indirect, Match
    By ruslan_adx in forum Excel General
    Replies: 1
    Last Post: 10-08-2009, 03:35 AM
  7. using index/match & Indirect
    By jwongsf in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 02-14-2009, 10:14 PM

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