+ Reply to Thread
Results 1 to 8 of 8

Lookup data across multiple tables

  1. #1
    Registered User
    Join Date
    01-29-2009
    Location
    Berkshire, England
    MS-Off Ver
    For Office 365
    Posts
    57

    Lookup data across multiple tables

    I'm stuck! What I want to do seems like it would be simple, but I am struggling!

    I want to look up values and return values 2 cells below, much like using hlookup. However, the lookup values are not all in the same row. I have attached an example. As you can see, there is basically a table for each month. What I want to do is look up each date across all months and return a value 2 cells below.

    It's probably something simple, but I just can't get it

    Thanks
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    01-24-2020
    Location
    Just behind that tree
    MS-Off Ver
    2013
    Posts
    13

    Re: Lookup data across multiple tables

    Hiya! This worked for me: =XLOOKUP(B26,$B$2:$AF$2,$B$4:$AF$4,0,0,1). If you were to put your data next to each other, instead of underneath, you would be able to drag the formula to cover wherever you want it to go. Otherwise, you need to change the range once you've finished up to and including AF40.

  3. #3
    Registered User
    Join Date
    01-29-2009
    Location
    Berkshire, England
    MS-Off Ver
    For Office 365
    Posts
    57

    Re: Lookup data across multiple tables

    Thank you QuieT
    Unfortunately, neither moving the data to all be alongside or changing the formula after AF40 are an option for me. The example I attached is just a very scaled down example. The worksheet on which I will eventually use it contains hundreds of columns and thousands of rows

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Lookup data across multiple tables

    Okay, the hundreds of columns throws me because my solution resolves around having 1 month a row. Maybe describe how your data will be set up a little more.

    XLOOKUP will only work online (for now) and if you have Office 365. This works for your example
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Lookup data across multiple tables

    Hi
    Use this in D26 and down:

    =INDEX($B$1:$AF$20,SMALL(IF($B$2:$AF$20=B26,ROW($B$2:$AF$20)+2),1),SMALL(IF($B$2:$AF$20=B26,COLUMN($B$2:$AF$20)),1)-1)
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Lookup data across multiple tables

    The former is an array formula. You can use this instead In D26 and down:

    =INDEX($B$1:$AF$20,AGGREGATE(14,6,(($B$2:$AF$20=B26)*ROW($B$2:$AF$20)),1)+2,AGGREGATE(14,6,(($B$2:$AF$20=B26)*COLUMN($B$2:$AF$20)),1)-1)

  7. #7
    Registered User
    Join Date
    01-29-2009
    Location
    Berkshire, England
    MS-Off Ver
    For Office 365
    Posts
    57

    Re: Lookup data across multiple tables

    Quote Originally Posted by ChemistB View Post
    Okay, the hundreds of columns throws me because my solution resolves around having 1 month a row. Maybe describe how your data will be set up a little more.

    XLOOKUP will only work online (for now) and if you have Office 365. This works for your example
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Thank you ChemistB. Looking at what you have done makes me realise that using an example of consecutive days, separated by month complicated the issue, rather than simplifying it as I had expected. In the actual file I was using, as days went across, they were 7 days across, not just 1, starting in June. Each section had 50 days across (hundreds of columns, because they were merged cells, due to the data in the rows beneath), so your formula, which would be good in what I now see as a flawed example, wouldn't work in the main file. However, it has given me a better understanding of using the date function, with the year and month functions within, so has still been a help to me. thank you for your time

  8. #8
    Registered User
    Join Date
    01-29-2009
    Location
    Berkshire, England
    MS-Off Ver
    For Office 365
    Posts
    57

    Thumbs up Re: Lookup data across multiple tables

    Quote Originally Posted by belinda200 View Post
    Hi
    Use this in D26 and down:

    =INDEX($B$1:$AF$20,SMALL(IF($B$2:$AF$20=B26,ROW($B$2:$AF$20)+2),1),SMALL(IF($B$2:$AF$20=B26,COLUMN($B$2:$AF$20)),1)-1)
    Quote Originally Posted by belinda200 View Post
    The former is an array formula. You can use this instead In D26 and down:

    =INDEX($B$1:$AF$20,AGGREGATE(14,6,(($B$2:$AF$20=B26)*ROW($B$2:$AF$20)),1)+2,AGGREGATE(14,6,(($B$2:$AF$20=B26)*COLUMN($B$2:$AF$20)),1)-1)
    Belinda, you've come up trumps again. Both of your suggestions have worked a treat! Thank you

+ 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. Lookup tables / data in multiple cells?
    By jeff0181 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-26-2019, 04:54 AM
  2. [SOLVED] Lookup multiple items and return in multiple tables
    By ima_ms in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 10-22-2019, 07:31 AM
  3. [SOLVED] Lookup Multiple Tables, match, and extract relevant data
    By q8books in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-15-2013, 03:51 PM
  4. Replies: 2
    Last Post: 05-10-2012, 10:38 AM
  5. Multiple tables lookup
    By tornado1981 in forum Excel General
    Replies: 3
    Last Post: 04-04-2010, 10:46 AM
  6. multiple lookup tables
    By ministerofdeath in forum Excel General
    Replies: 1
    Last Post: 03-24-2009, 03:52 AM
  7. [SOLVED] Using Multiple LOOKUP tables
    By KG in forum Excel General
    Replies: 3
    Last Post: 05-06-2005, 08:06 PM

Tags for this Thread

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