+ Reply to Thread
Results 1 to 15 of 15

Formula for table array

  1. #1
    Registered User
    Join Date
    07-06-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    7

    Formula for table array

    Help would be much appreciated on a problem I have.

    I will try my best to explain.

    In a spreadsheet I have a large table in one tab with a row of numbers, and column of numbers with an array of numbers under each.

    Closes example I could find on google is

    http://www.csus.edu/indiv/j/jensena/.../eld_npe_t.jpg

    except instead of words for months I have numbers.

    In another tab I have input cell where in the above picture for example I would type the month in one cell, and the year in the other.

    In another row I would then need the answer displayed that relates to that month and year.

    The other issue I have is that when imputing two values to search for, they wont be the exact values in the look up table.

    I.e

    The look up table lists in the first column, 1,1.2,1.4,1.6 etc
    and the first row lists 2,4,6,8,10

    and in-between would be a vast amount of numbers

    I would enter 1.5 and 5 to look up
    which I would want to return the next highest value, relating to 1.6 and 6

    so I need to but in a more than part to a double look up equation??

    Thank you for your help and time.
    Last edited by woody369; 07-14-2009 at 07:34 AM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Please help on formula (Lookup? IF?)

    Welcome to the forum.

    Please take a few minutes to read the forum rules, and then amend your thread title accordingly.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    07-06-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Formula for table array

    Sorry. Hope the change is satisfactory.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula for table array

    I would say so yes... but to further assist...

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

  5. #5
    Registered User
    Join Date
    07-06-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Formula for table array

    How would I attach a workbook to the forum?

    Recommended file hosting?

    Thank you.

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula for table array

    When you post a reply use the paperclip icon above the message box to manage attachments (if you can't see it click "Go Advanced" below the message box)

  7. #7
    Registered User
    Join Date
    07-06-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Formula for table array

    Thank you.

    This should show my issue. The calculator sheet will basically have a height and distance input and a value for an answer.

    The table on the other sheet is much bigger, but shows simply the idea.
    Attached Files Attached Files

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula for table array

    Based on your sample file and narrative in first post I think perhaps:

    Please Login or Register  to view this content.

  9. #9
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Formula for table array

    DonkeyOte,

    What does this part of the formula accomplish?

    +ISNA(MATCH($D6,'Lookup Table'!$A$4:$A$14,0))



    Edit: never mind, I understand it adds "1" to advance to the next row/column if there is not exact match found.
    Last edited by Palmetto; 07-10-2009 at 10:17 AM.

  10. #10
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula for table array

    Consider: A1:A3

    1
    10
    15

    Criteria: 12

    Requirement: return match position of first number >= criteria

    MATCH(12,A1:A3) --> returns 2 given 10 is the last value <= criteria

    given we want to return 3 as 15 is the real value we want we can just test to see if 12 exists in the range, if it does the answer stands, if not add 1 to result...

    ISNA(MATCH(12,A1:A3,0))

    if the above returns TRUE we know 12 does not exist in A1:A3 so we add 1 to result... if criteria were 10 the ISNA would return FALSE thus result would remain as 2.
    Last edited by DonkeyOte; 07-10-2009 at 10:22 AM. Reason: removed point re: COUNTIF - not really relevant here

  11. #11
    Registered User
    Join Date
    07-06-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Formula for table array

    Thank you for your help, I hadn't even thought of this approach.

    The formula given had $D$6 though, which confused me at first as when copying it down the distance input above affected the result, but seems fine now I removed the $.

    I will now try to adjust to the bigger table I need it to work on and hopefully will all work well.

    Thanks for now.

  12. #12
    Registered User
    Join Date
    07-06-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Formula for table array

    I altered the formula to

    =IF(COUNT($H15:$P15)=2,INDEX('ce,(z) look up'!$B$4:$DG$104,MATCH($H15,'ce,(z) look up'!$A$4:$A$104)+ISNA(MATCH($H15,'ce,(z) look up'!$A$4:$A$104,0)),MATCH($P15,'ce,(z) look up'!$B$3:$DG$3)+ISNA(MATCH($P15, 'ce,(z) look up'!$B$3:$DG$3,0))),"")

    just replacing the two inputs with new cell references, and the table data, row column information etc.

    Can you see any problems with it on its own?

    Additionally it says it has created a circular reference, which I can't seem to see.

  13. #13
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula for table array

    Re: formula

    One obvious change would be to change

    =IF(COUNT($H15:$P15)=2,

    to

    =IF(COUNT($H$15,$P15)=2,

    If altering the above does not resolve the circular reference we'd first need to know in which cell the formula resides etc...

  14. #14
    Registered User
    Join Date
    07-06-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Formula for table array

    Aha, Cheers.

    Seems all sorted now, thank you very much.

    Just out of interest, what does the =2 bit mean?

  15. #15
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula for table array

    Just out of interest, what does the =2 bit mean?
    Simply checks to make sure both cells contain a numerical value before attempting to run the Matches, in reality you could extend to make the test more robust (to ensure numerical values are within min range) but as is may prove sufficient.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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