+ Reply to Thread
Results 1 to 13 of 13

INDEX / MATCH using multiple tables depending on values?

  1. #1
    Forum Contributor
    Join Date
    01-12-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2016
    Posts
    152

    INDEX / MATCH using multiple tables depending on values?

    Hi Guys,

    I have a formula I am unable to crack, hoping you can help. Attached is an example, hopefully self-explanatory but heres the run down.

    Depending on Data in C5 & C7 decides which table to use. I have used CONCATENATE as I was looking to use the INDIRECT function to point to the direction of the table required?

    Once we have the right table I need to use a Vlookup or INDEX /MATCH type of function to match both axis of the table to the data in C9 and C11 and match the data in the table!

    Hope you can help and thanks in advance!
    Attached Files Attached Files
    Last edited by nostrum; 06-13-2019 at 11:53 AM.

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Table Data Help!

    Please try at C14
    =INDEX(H:N,AGGREGATE(15,6,ROW(G5:G73)/(G5:G73=C9)/(ROW(G5:G73)>MATCH(C5&" "&C7,G:G,)),1),MATCH(C11,H5:N5))

    Data Validation for C9
    =OFFSET($G$1,MATCH(C5&" "&C7,G:G,),,AGGREGATE(15,6,ROW($G$5:$G$74)/($G$5:$G$74=0)/(ROW($G$5:$G$74)>MATCH(C5&" "&C7,G:G,)),1)-MATCH(C5&" "&C7,G:G,)-1)
    Attached Files Attached Files

  3. #3
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Table Data Help!

    Hi

    @Bo_Ry has a great solution to get the value. My solution is worse.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    On the other hand, it provided data validation whose formula is exaggerated
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    01-12-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2016
    Posts
    152

    Re: Table Data Help!

    Hi Guys,

    Thanks for the help here, much appreciated.

    Just to clarify The only formula required is for C14, the other boxes will have been filled from another source already. I tried the first formaula in C14 but it has a NUM! error!

    Much appreciated

  5. #5
    Forum Contributor
    Join Date
    01-12-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2016
    Posts
    152

    Re: Table Data Help!

    Just to add for clarification, The answer to my example would be 29 from cell L55.

    This is because it is from table B1800 (B coming from C5 and 1800 coming from C7) and row 55 coming from C9 (closest to 1.6 being 1.5) and L resulting from a direct match from C11 (10)

    Hope that makes sense?

  6. #6
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Table Data Help!

    Hi

    I maintained your data validation for C9, and implemented 2 formulas and adapted the @Bo_Ry solution.
    The second formula takes into account that the headers of zone B are general and take line 45 as the default for the search. In the first formula was taken the line referring to the search of group 'B 1800' in line 51.

    See the formulas and the file

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    01-12-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2016
    Posts
    152

    Re: Table Data Help!

    Hi Jose,

    Thanks very much for the help!

    Unfortunately, it just doesn't seem to be doing what I'd have hoped

    Not sure where it's going wrong, just some of the results don't match

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,434

    Re: Table Data Help!

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  9. #9
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Table Data Help!

    @José Thanks, but I think my and your formula doesn't check for closest value.

    Quote Originally Posted by nostrum View Post
    row 55 coming from C9 (closest to 1.6 being 1.5) and L resulting from a direct match from C11 (10)
    if C9 = 2 then it close to both 1.5 and 2.5

    This one choose 2.5
    =INDEX(H:N,MOD(MIN(INDEX(ABS(INDEX(G:G,MATCH(C5&" "&C7,G:G,)+1):INDEX(G:G,AGGREGATE(15,6,ROW(G5:G74)/(G5:G74=0)/(ROW(G5:G74)>MATCH(C5&" "&C7,G:G,)),1)-1)-C9)*10^5+ROW(INDEX(G:G,MATCH(C5&" "&C7,G:G,)+1):INDEX(G:G,AGGREGATE(15,6,ROW(G5:G74)/(G5:G74=0)/(ROW(G5:G74)>MATCH(C5&" "&C7,G:G,)),1)-1)),)),1000),C11-5)


    This one choose 1.5
    =INDEX(H:N,-MOD(MIN(INDEX(ABS(INDEX(G:G,MATCH(C5&" "&C7,G:G,)+1):INDEX(G:G,AGGREGATE(15,6,ROW(G5:G74)/(G5:G74=0)/(ROW(G5:G74)>MATCH(C5&" "&C7,G:G,)),1)-1)-C9)*10^5-ROW(INDEX(G:G,MATCH(C5&" "&C7,G:G,)+1):INDEX(G:G,AGGREGATE(15,6,ROW(G5:G74)/(G5:G74=0)/(ROW(G5:G74)>MATCH(C5&" "&C7,G:G,)),1)-1)),)),-1000),MATCH(C11,H5:H5:N5))
    Last edited by Bo_Ry; 06-13-2019 at 11:58 AM.

  10. #10
    Forum Contributor
    Join Date
    01-12-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2016
    Posts
    152

    Re: INDEX / MATCH using multiple tables depending on values?

    Hi,

    Sorry for the rule break, does the title suit the topic now?

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

    Re: INDEX / MATCH using multiple tables depending on values?

    Yes - much better, thank you.

  12. #12
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: INDEX / MATCH using multiple tables depending on values?

    Hi

    The approach I use to catch that is use the same formulas but with a rounded value of C9, accordingly with A or B
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Result_1, Result_2 and Result_3
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    See the file
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    01-12-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2016
    Posts
    152

    Re: INDEX / MATCH using multiple tables depending on values?

    Thanks for the help guys,

    Bo_Ry appears to have cracked it. Sorry for the delay responding I have only just managed to give it another try!

    Much appreciated

+ 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. Move data from 1 table to another table, then clear the original table
    By kwoltman in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-03-2019, 06:06 PM
  2. [SOLVED] Replace data in a table with same data from another table, bringing formatting with it.
    By Strykewulf in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-24-2019, 12:55 PM
  3. [SOLVED] Copy paste data from table to another table then delete data without losing formulas
    By dps9460 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-11-2019, 03:14 AM
  4. Replies: 1
    Last Post: 11-28-2013, 02:10 AM
  5. Replies: 0
    Last Post: 09-05-2012, 06:12 PM
  6. Export Excel data into Access table - overwrite table data
    By Jonsocks in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-08-2012, 12:05 PM
  7. Replies: 0
    Last Post: 02-20-2012, 02:53 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