+ Reply to Thread
Results 1 to 20 of 20

index match return value

  1. #1
    Registered User
    Join Date
    05-23-2015
    Location
    Sydney, Australia
    MS-Off Ver
    Office for Mac 2011
    Posts
    68

    index match return value

    hi,
    just a quick question, can an index match return the value that it looks up to a different cell than the one it is in?

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,422

    Re: index match return value

    Quick answer: no.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,422

    Re: index match return value

    Yes, you can add or subtract values in the MATCH part of the formula, so that you can select different rows or columns.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    05-23-2015
    Location
    Sydney, Australia
    MS-Off Ver
    Office for Mac 2011
    Posts
    68

    Re: index match return value

    Quote Originally Posted by Pete_UK View Post
    Yes, you can add or subtract values in the MATCH part of the formula, so that you can select different rows or columns
    yeah just knowing it can be done helps.
    here is a formula i have and it returns the value to the cell it is in, can you help me with the syntax so it returns the value to a different cell? any cell will do i can change it to suit.
    =INDEX(Index!$E$2:$AP$300, MATCH(A$2, Index!$A$2:$A$300, 0), ROW($A1))

    many thanks in advance

  5. #5
    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 match return value

    I think that your request may have ben misunderstood.... You can't (sa far as I'm aware) tell Excel to put ht evalue elsewhere. you can copy the value to another cell, or put the formula to the palce where you want the answer to be. I also think that if you were to explain better (with a sample sheet) what you want (and why) it might be possible to come up with an alternative.
    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

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,422

    Re: index match return value

    I agree with Glenn - a formula can't send a value to another cell, it can only display a value in the cell in which the formula is placed. I misunderstood what you were asking.

    Pete

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,422

    Re: index match return value

    For clarification, a longer answer: a formula, INDEX/MATCH or whatever, can only return a value to the cell where the formula resides. It cannot output a value to a different cell. The value returned by the MATCH can be adjusted by a constant value or another formula but, again, the result is in the cell with the formula in it.

    What you are asking can not be done.

    Regards, TMS

  8. #8
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,885

    Re: index match return value

    It can if you put it in a macro.
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,422

    Re: index match return value

    @Jacc:
    It can if you put it in a macro.

    Yes, it probably can, but that wasn't the question and the question is in the Formulas and Functions sub-forum, not VBA.


    Perhaps you would care to provide an example of a macro or event handler that would cater for the OP's requirements as quoted in Post #4?

  10. #10
    Registered User
    Join Date
    05-23-2015
    Location
    Sydney, Australia
    MS-Off Ver
    Office for Mac 2011
    Posts
    68

    Re: index match return value

    gosh thanks to everyone for putting in so much effort for just a simple thing like this. I mean honestly i don't do this for work or someone else, its just for fun to use in a game that i play with mates on the weekends so i really appreciate how in depth you are all getting for little old me.

    in regard to a sample sheet, i would love to post one but the data makes the file size too large and i don't know how to break it apart and still make it work but to explain further for those who are interested:
    i have a sheet with cascading drop downs and a reset button that deletes the drop downs. i put the above formula into the cels beneath the drop downs to reference information relevant to what i pick in the drop downs which works well but then i realised the reset button clears the drop downs but not the information underneath. so anyway i extended the range on the reset to cover the extra cells in the columns but didn't realise it also deletes the formulas in those cells as well. that is why i thought i might be able to still use the formula but put it in another cell and tell it to drop the indexed value elsewhere that i want.

    thanks for the help anyway

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,422

    Re: index match return value

    If you're already using VBA to clear cells, then just add another line of code to put the formula back.

    For example:

    Please Login or Register  to view this content.
    Change "X30" to the cell where you want the formula to go (where it was originally)


    Regards, TMS

  12. #12
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,885

    Re: index match return value

    Quote Originally Posted by TMS View Post
    @Jacc

    Perhaps you would care to provide an example of a macro or event handler that would cater for the OP's requirements as quoted in Post #4?
    Not anymore, no.

  13. #13
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,422

    Re: index match return value

    @Jacc: oh, I'm disappointed

  14. #14
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,885

    Re: index match return value

    Yup, that's a big loss for the forum. It would have been a great event handler.

  15. #15
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,422

    Re: index match return value

    @Jacc: I like you

  16. #16
    Registered User
    Join Date
    05-23-2015
    Location
    Sydney, Australia
    MS-Off Ver
    Office for Mac 2011
    Posts
    68

    Re: index match return value

    Quote Originally Posted by TMS View Post
    If you're already using VBA to clear cells, then just add another line of code to put the formula back.

    Change "X30" to the cell where you want the formula to go (where it was originally)
    TMS,
    thanks so very muchly for your awesome help i used your line in the vba i have adding it to the end of the reset function and then changed the "X30" as advised and it worked perfectly!! so thanks.

    oh and i learned something odd, in the sheet i have, the formula goes into a 50 by 50 cell grid but not the top 2 rows as thats where i have some text and the cascading drop downs, so i was confounded briefly on how i would change the cell reference to put the formula back into all 50 rows and columns without it going into the top 2 rows.
    first i tried the reference A3:A50 and that worked fine for the first row. then i just wildly guessed that if i put a comma after the A50 i could reference the second row like this A3:A50,B3:B50 and that worked too. but then i realised if i was going to do it this way, i would have to do it for all 50 columns and that would be just ridiculous so i guessed again wildly and thought what would happen if i just referenced the lot like this A3:AX50 thinking it would show an error for trying to put the formula in rows 1 and 2 but to my surprise, it only put the formula in to rows 3 onwards. so it worked perfectly.

    your help has been soo awesome i thank you so very much

  17. #17
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,422

    Re: index match return value

    You're welcome.

  18. #18
    Registered User
    Join Date
    05-23-2015
    Location
    Sydney, Australia
    MS-Off Ver
    Office for Mac 2011
    Posts
    68

    Re: index match return value

    @TMS i tried replying to your earlier quote with the code but it didn't seem to work, however your code was awesome and worked a treat.

    thanks so much you've completely answered my question and then some, ill leave this thread for now and post my other questions (although related to this workbook I'm making) in new threads in the appropriate places.

    cheers!

  19. #19
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,422

    Re: index match return value

    You're welcome. Thanks for the rep.

  20. #20
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,885

    Re: index match return value

    @TMS Peace out!

    *fist bump*

+ 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. Replies: 5
    Last Post: 10-16-2016, 02:33 AM
  2. [SOLVED] Vlookup/index/match to return all values that match
    By Asil01 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-09-2014, 12:49 PM
  3. [SOLVED] Combining 3 Formulas: Return all Names that Match Criteria Using Index/Match
    By bchilme in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 09-29-2014, 09:28 AM
  4. Using Index/Match to return multiple values for one match
    By superboy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-10-2014, 06:21 PM
  5. [SOLVED] INDEX MATCH then return a 0 instead of #N/A
    By AlixNB in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-02-2014, 05:02 AM
  6. VLOOKUP/INDEX/MATCH to return all values that match
    By lijia00 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2014, 11:56 AM
  7. Replies: 3
    Last Post: 05-08-2013, 02:10 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