+ Reply to Thread
Results 1 to 7 of 7

Table Results - Index Match for Row & Column returns incorrect values

  1. #1
    Registered User
    Join Date
    03-17-2022
    Location
    Texas
    MS-Off Ver
    Excel 365
    Posts
    3

    Table Results - Index Match for Row & Column returns incorrect values

    I've attached the file where the operative function in column I that's giving me trouble is:

    =INDEX(PPS[[0]:[61]],MATCH(D2,PPS[Months],0),MATCH(G2,PPS[[#Headers],[0]:[61]]))

    The descriptive row is not to be referenced, merely easier for co-workers to read the table if needed.
    The top table is a standard excel workspace.
    The bottom table "PPS" is a formatted table for the referencing of the performance standard hours

    I'm finding two problems really.

    1) If someone with 10 or less months is searched, the table returns incorrect values. I'm lost in the sauce.
    2) If the Tenure in Months column is manually changed and months are entered as a pure number, the formula in column I breaks. I don't understand why. While not imperative to what I'm trying to do, it would be nice to correct this or at least understand why.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,219

    Re: Table Results - Index Match for Row & Column returns incorrect values

    Hi matdul01 and welcome to the forum,

    Perhaps you missed the "1" for True in your formula towards the end???

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    03-17-2022
    Location
    Texas
    MS-Off Ver
    Excel 365
    Posts
    3

    Re: Table Results - Index Match for Row & Column returns incorrect values

    No effect

    I already tried the 1, 0, -1 there because it took me a long time in the first place to get the first half of the Match to work. 1 doesn't have an effect there, 0 only works if the tenure matches the minimum number column heading exact, so it's not useful if they are 1-3, 5-6, 8-9 months etc., -1 also breaks it.

  4. #4
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    3,168

    Re: Table Results - Index Match for Row & Column returns incorrect values

    I don't believe the values in "Months" column in the top and the Months headers in the bottom are being interpreted the same by excel. Try wrapping the "numbers" in NUMBERVALUE like this (in cell I2 and copy down):

    =INDEX(PPS[[0]:[61]],MATCH(D2,PPS[Months],0),MATCH(NUMBERVALUE(G2),NUMBERVALUE(PPS[[#Headers],[0]:[61]]),1))

  5. #5
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Table Results - Index Match for Row & Column returns incorrect values

    The months in row 26 and column G are both being treated as text. This causes both of your problems, firstly because numbers are not ordered the same way when stored as text (e.g. "10" is treated as less than "2" because it goes character by character), and secondly because if you replace column G with numbers then it's trying to compare a number with text and causes an error.

    So the best way is to convert both your month ranges to numbers at source. If you want to keep the inputs as they are though, you could force them to numbers within the formula with something like this in I2, copied down:

    =INDEX(PPS[[0]:[61]],MATCH(D2,PPS[Months],0),MATCH(G2+0,PPS[[#Headers],[0]:[61]]+0))

  6. #6
    Registered User
    Join Date
    03-17-2022
    Location
    Texas
    MS-Off Ver
    Excel 365
    Posts
    3

    Re: Table Results - Index Match for Row & Column returns incorrect values

    Both Gregb11 and nick.williams solutions worked! Thank you! I'd had a previous version of this where someone had me add *1 to the lookup value, I couldn't remember why but with both your answers this makes sense, but when I tried adding that this time it didn't work and I dont' know why.

    The weird part is i tried changing both the G column and Row 26 to format of number, but that also didn't make a difference and I dont' know if i ever will at this point.

  7. #7
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Table Results - Index Match for Row & Column returns incorrect values

    Glad it worked

    The cell formatting doesn't (or at least doesn't usually) affect how Excel treats the actual value in the cell. e.g. if you type ="1" in a cell, and format it as a number, it will still be treated as text.

    But you can "force" values to the right format, e.g.

    Add &"" on the end will force something to text

    Add +0 on the end will force something to a number (dates are numbers too). This will cause an error if it is not really a number though. So if you have "5"+0 it will force it to a number, but "text"+0 will just give an error.

    You can alternatively use -- at the start, or multiply by 1, to force things to a number. Be careful that everything is enclosed in brackets when doing this e.g. ("5"&"5")*1 will be 55 (number), but "5"&"5"*1 becomes "5"&5 which becomes "55" (text).

+ 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. [SOLVED] INDEX & MATCH returns partially incorrect match after sorted
    By chaiyya345 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-16-2020, 08:50 PM
  2. [SOLVED] Problems with INDEX, MATCH, MATCH returning incorrect values
    By Paul103 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-03-2018, 05:16 PM
  3. [SOLVED] INDEX & 2x MATCH returning incorrect values
    By Dan_B in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-06-2017, 06:01 AM
  4. [SOLVED] Index Match Match returning incorrect value from table
    By DaveBre in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-04-2014, 08:01 PM
  5. [SOLVED] Index Match returning incorrect values
    By SomeDude0nline in forum Excel General
    Replies: 2
    Last Post: 07-23-2014, 10:20 AM
  6. Index match returning incorrect values
    By Mrpussalia in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-23-2014, 10:55 PM
  7. Days360 Returns Incorrect Results Sometimes
    By goss in forum Excel General
    Replies: 2
    Last Post: 03-19-2014, 12:57 AM

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