+ Reply to Thread
Results 1 to 9 of 9

Index Match Formula doesn't recognize output from Right Formula as lookup value.

  1. #1
    Registered User
    Join Date
    12-06-2012
    Location
    charlotte, nc
    MS-Off Ver
    Excel 2003
    Posts
    10

    Index Match Formula doesn't recognize output from Right Formula as lookup value.

    Hello,

    I am attempting to write what I would think would be a simple formula. (this is the simplified version).

    =index(E1:E2,match(right(A1,2),D1:D2,0))

    A1:Jan-12

    D1:12
    D2:13

    E1:FY12
    E2:FY13

    The match doesn't recognize the output of "12" from the right function.

    This is what I've attempted so far:
    Formatting between numbers, general, and text.
    I have used right formula as it's own cell and then tried to reference that cell.
    I have copied and pasted value the right formula cell.
    The only time it works is if I paste values, then click in the formula bar and it enter, then it will move the number to the right and the formula will work when that cell is referenced. Considering I have 500k lines this is not an option.

    Thank you in advance.

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Index Match Formula doesn't recognize output from Right Formula as lookup value.

    The values in cells D1 and D2 are likely numbers, but the output of your RIGHT function will be treated as text. Try this approach:

    Please Login or Register  to view this content.
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  3. #3
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Index Match Formula doesn't recognize output from Right Formula as lookup value.

    The problem is that the value in A1 is a date and the RIGHT function is returning the last 2 digits from the serial number for the date.

    Change the format of A1 to text then re-enter Jan-12 this will make the entry of Jan-12 text that the RIGHT function will recognize the way that you want.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

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

    Re: Index Match Formula doesn't recognize output from Right Formula as lookup value.

    I don't recommend changing valid dates to a text as it ruins them for further calculations that require true dates/numbers.

    =INDEX(E1:E2,MATCH(RIGHT(YEAR(A1),2)+0,D1:D2,0))
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  5. #5
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Index Match Formula doesn't recognize output from Right Formula as lookup value.

    I don't disagree with Palmetto. If the date is just an identifier, it doesn't matter, but if you are going to be doing calculations with the date, it would be easier to have the date a "real" date and use a formula such as he gave you to make the calculation requested.

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Index Match Formula doesn't recognize output from Right Formula as lookup value.

    I know this will get you the last two digits for the year. you can incorporate it in your formula.

    =TEXT(K4,"YY")
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  7. #7
    Valued Forum Contributor
    Join Date
    11-15-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2003
    Posts
    538

    Re: Index Match Formula doesn't recognize output from Right Formula as lookup value.

    I identify somewhat with the O.P. in this regard: when I paste Access grids into Excel, and there is a "potentially" numeric value but to Access it's text (e.g. 0000777), it looks like 0000777 when you paste it...

    Try
    SELECT "0000777" AS Expr1, "0123" AS Expr2
    FROM anytable;
    (Pick a table with few records for fast results).

    When you paste the result to Excel, and hit F2 and enter on a pasted cell, it changes similar to OP's description. Excel "feature not a bug" stuffs what appears to be a numeric conversion down your throat. Worse yet, if you wanted to edit 0000777 and change it to 0000779, you better not use F2 (or click in the formula bar, like OP) and enter, or those leading digits are gone, forever. BTW, if you search and replace 7 with 9, the same thing happens.

    I don't know how to turn off this behavior. I've looked for an option. (But, hey, who am I, a user(cough, sheep, cough), to presume that I know what I want better than Excel developers who hardcode what they know is best for me). Related: is there a way to "turn off" Text-To-Column "memory?" It's a great feature, but after you do it once, it keeps doing it on future pastes, whether you want to or not. A feature, you know.

    I'm not sure that this exactly equates to OP dilemma. Dates are numbers though, and in my example things "shift to the right" like OP described.
    Chip, if you can read this, you're STILL making the world a better place with your immeasurably valuable gifts. Every week, you continue to help me (and untold numbers of others) tremendously. Practically no alternative outlets can match your effectiveness, even over the vast number of topics you demystify and empower usage of. You were, and still are, amazing.

  8. #8
    Registered User
    Join Date
    05-15-2014
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Index Match Formula doesn't recognize output from Right Formula as lookup value.

    Easy fix for the Text to Columns issue without closing Excel: select 1 or more cells in a single column and go through the steps to Text to Columns again; only de-select all options then hit "Finish" and it will remember those settings instead. it will, of course, reset when you open Excel again, but a good trick if you use Excel with multiple workbooks open at once and would rather not close them.

  9. #9
    Valued Forum Contributor
    Join Date
    11-15-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2003
    Posts
    538

    Re: Index Match Formula doesn't recognize output from Right Formula as lookup value.

    Loiselle, that is a great discovery. I very much like your thinking about accomplishing this without having to succumb to the idiotic need to close and reopen Excel!

+ 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