+ Reply to Thread
Results 1 to 16 of 16

lookup data in the database of Excel Tables WITHOUT AN ARRAY FORMULA

  1. #1
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    lookup data in the database of Excel Tables WITHOUT AN ARRAY FORMULA

    I have a database in excel that I converted to “Excel Tables” to eliminate the many dynamic named ranges I was using.

    My next goal is, FROM A DIFFERENT WORKBOOK to lookup data in the database of Excel Tables WITHOUT AN ARRAY FORMULA { Ctrl-Shft-Enter }.
    (I realize INDEX is technically an array but not for the purposes of this conversation.)

    I found a solution but it only works with exact matches and I need it to match on >=.
    (BTW, There are four columns involved and it is simply not possible to sort all data ascending or descending in every column of interest at once.)

    See the workbook attached. (In the sample attached workbook the table resides in the same workbook as the formula.)

    *********
    For those not willing to open the workbook I will attempt to describe:
    Table1 Column Headings:
    T....W...L..G..C
    187 4 10 36 1
    .187 6 20 36 2
    .250 4 10 36 3
    .250 6 20 36 4

    This works for an exact match:
    =INDEX(Table1[[#All],[C]], MATCH(J1&J2&J3&J4, INDEX(Table1[[#All],[T]]&Table1[[#All],[W]]&Table1[[#All],[L]]&Table1[G],),0))
    Search Criteria of .187, 6, 20, 36 correctly returns 2.00 from column heading “C”


    How to obtain the same result using search criteria of .187, 5, 20, 36
    “5” should match the row containing 6 in “W” as 6 >= 5 and return 2.00 from column heading “C”

    I tried adding >=J2 with no luck.
    = INDEX(Table1[[#All],[C]], MATCH(J1& ">=J2” &J3&J4, INDEX(Table1[[#All],[T]]&Table1[[#All],[W]]&Table1[[#All],[L]]&Table1[G],),0))

  2. #2
    Forum Contributor
    Join Date
    08-07-2015
    Location
    AB, Canada
    MS-Off Ver
    Excel 2013 x64
    Posts
    132

    Re: lookup data in the database of Excel Tables WITHOUT AN ARRAY FORMULA

    Let me know if this works for you.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    Re: lookup data in the database of Excel Tables WITHOUT AN ARRAY FORMULA

    No it did not.

    For some reason I can't upload the workbook. Maybe it's my employer. I've not had problems in the past uploading from elsewhere.

  4. #4
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    Re: lookup data in the database of Excel Tables WITHOUT AN ARRAY FORMULA

    bump bump bump

  5. #5
    Forum Contributor
    Join Date
    08-07-2015
    Location
    AB, Canada
    MS-Off Ver
    Excel 2013 x64
    Posts
    132

    Re: lookup data in the database of Excel Tables WITHOUT AN ARRAY FORMULA

    It's difficult for me to tell what the issue is without more information. Maybe try uploading a sample file again when you're not at work and sending me another reply. Sorry I'm not more help with the current information.

  6. #6
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    Re: lookup data in the database of Excel Tables WITHOUT AN ARRAY FORMULA

    see attached workbook

  7. #7
    Forum Contributor
    Join Date
    08-07-2015
    Location
    AB, Canada
    MS-Off Ver
    Excel 2013 x64
    Posts
    132

    Re: lookup data in the database of Excel Tables WITHOUT AN ARRAY FORMULA

    I can't seem to come up with a solution that doesn't use array formulas. If you decide that you can accept an array formula solution, you can use the formula below to produce your desired result.

    Please Login or Register  to view this content.
    Best of luck!

  8. #8
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    Re: lookup data in the database of Excel Tables WITHOUT AN ARRAY FORMULA

    Bump ....still looking for a non-array solution

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

    Re: lookup data in the database of Excel Tables WITHOUT AN ARRAY FORMULA

    Try this in L1

    =LOOKUP(2,1/((Table1[T]=N1)*(Table1[W]>=N2)*(Table1[L]=N3)*(Table1[G]=N4)),Table1[C])

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: lookup data in the database of Excel Tables WITHOUT AN ARRAY FORMULA

    Why the desire for a non-array answer?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  11. #11
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    Re: lookup data in the database of Excel Tables WITHOUT AN ARRAY FORMULA

    FDibbins
    The main reason for non-array is I'm the only one in my company that knows what an array formula is and training is a futile effort. The users don't report to me.
    Additionally, moving from Dynamic named ranges to Excel Tables means the future database admin don't have to insure all cells in a column contain data.
    I have a cost calculator that runs without any user input and is chock full of array formulas and often takes longer than you care to wait to calculate.
    But the main reason is the new cost calculator I am working on there will be a lot of user interface. I have the page protected just to keep people from accidently overwriting something but they need to be able to unprotect and carefully make changes from time to time. I can't rely on the users to remember to use Ctrl-Shft-Enter. I have comments on all the field headings "ARRAY FORMUAL {} Ctrl-Shft-Enter" but this is a disaster waiting to happen. I can't create a zillion userforms for their custom data input as this needs to be a quick process.


    Jonmo1
    You formula works exactly as I requested on my sample, however I was not complete in my request.
    I also need >=N3

    The problem is the same data in T W L & G repeat and they CANNOT be sorted such that all columns are ascending, which is why I initially ignored the LOOKUP option.

    my current array formula with named ranges for reference is:
    INDEX(RngDbC,MATCH(1,(RngDbT = N1)*(RngDbW >= N2)*(RngDbL >= N3)*(RngDbG = N4),0),1)

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

    Re: lookup data in the database of Excel Tables WITHOUT AN ARRAY FORMULA

    Are you able to use macros?
    You could set up an event code that auto array-enter a formula if a user makes changes to it.


    Anyway, you should be able to change the =N3 to >=N3 in the formula I posted.

  13. #13
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    Re: lookup data in the database of Excel Tables WITHOUT AN ARRAY FORMULA

    When you put in .250, 3, 9 & 36 the answer I want is 3 or the row containing .250, 4, 10 & 36
    >=N3 returns 4 which does meet the criteria but so does 3 and I want 3

    I want the minimum >= not just anything >=


    Yes, worksheetchange code is an option but I would like to not have sheet change code running unless necessary

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

    Re: lookup data in the database of Excel Tables WITHOUT AN ARRAY FORMULA

    =LOOKUP(2,1/((Table1[T]=N1)*(Table1[W]>=N2)*(Table1[L]=N3)*(Table1[G]=N4)),Table1[C])

    So that works, but it returns the last one that meets the criteria (MAX)
    And you want the FIRST one that meets the criteria (MIN)

    =LOOKUP(2,1/((Table1[T]=N1)*(Table1[W]>=N2)*(Table1[L]=N3)*(Table1[G]=N4)),Table1[C])

    Try instead

    =INDEX(Table1[C],MATCH(1,INDEX((Table1[T]=N1)*(Table1[W]>=N2)*(Table1[L]>=N3)*(Table1[G]=N4),0),0))

  15. #15
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    Re: lookup data in the database of Excel Tables WITHOUT AN ARRAY FORMULA

    SUCCESS!

    Thank you! Would you believe I've used the Index buried in the Match to eliminate the array in this same workbook and it's just so huge I couldn't remember it to find it !

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

    Re: lookup data in the database of Excel Tables WITHOUT AN ARRAY FORMULA

    You're welcome

+ 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. Help with excel formula-lookup/pivot tables
    By JKKANG254 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-21-2020, 03:39 PM
  2. Consoldate data from 3 different tables in same database
    By MetroBOS in forum Access Tables & Databases
    Replies: 6
    Last Post: 04-12-2015, 11:13 PM
  3. Can I make the row lookup array/range part in an array formula variable?
    By OLLY-7 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-18-2014, 09:06 AM
  4. Excel lookup formula when using multiple pivot tables
    By sweetpea12 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-26-2013, 03:30 PM
  5. Replies: 13
    Last Post: 01-07-2011, 08:33 AM
  6. Creating data tables from a database without using pivot tables
    By gareth.campbell in forum Excel General
    Replies: 4
    Last Post: 11-24-2010, 12:23 PM
  7. Excel Lookup/Array Formula
    By minpyo78 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-02-2010, 05:08 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