+ Reply to Thread
Results 1 to 5 of 5

Mid Function nested in Index return #N/A

  1. #1
    Forum Contributor
    Join Date
    06-01-2014
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Microsoft 365
    Posts
    224

    Mid Function nested in Index return #N/A

    1000001 10 01000003 #n/a =index($b$1:$b$20,match(mid(d1,2,7),$a$1:$a$20,0),1)
    1000002 20 01000006 #n/a
    1000003 30 01000011 #n/a
    1000004 40 01000015 #n/a
    1000005 50 01000019 #n/a
    1000006 60
    1000007 70
    1000008 80
    1000009 90
    1000010 100
    1000011 110
    1000012 120
    1000013 130
    1000014 140
    1000015 150
    1000016 160
    1000017 170
    1000018 180
    1000019 190
    1000020 200
    Last edited by ibuhary; 10-08-2015 at 03:18 AM.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Mid Function nested in Index return #N/A

    Hi.

    Try coercing the string to a numeric first:

    =INDEX($B$1:$B$20,MATCH(0+MID(D1,2,7),$A$1:$A$20,0),1)

    Note that this will only work in all cases if all of your entries in column A are themselves numeric.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Forum Contributor
    Join Date
    06-01-2014
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Microsoft 365
    Posts
    224

    Re: Mid Function nested in Index return #N/A

    It works. Thanks.

    Does that mean Index function will not work for texts ???

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Mid Function nested in Index return #N/A

    It's not the INDEX function. It's MATCH, which will not consider a number and the equivalent number formatted as text as identical.

    If all of your entries are text, or all are numeric, then there's no issue. The problem arises when you are comparing a text value against a numeric one, as in your case.

    Regards

  5. #5
    Forum Contributor
    Join Date
    06-01-2014
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Microsoft 365
    Posts
    224

    Re: Mid Function nested in Index return #N/A

    Got it. Great ! Thank you so much.

+ 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 with Nested Match Function Help
    By T86157 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-30-2015, 12:43 PM
  2. Replies: 4
    Last Post: 03-27-2014, 01:09 PM
  3. [SOLVED] Nested INDIRECT in INDEX/MATCH function
    By xtort81 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-24-2014, 03:08 PM
  4. Replies: 4
    Last Post: 03-13-2013, 12:38 PM
  5. INDEX function with nested INDIRECT reference
    By jharris63 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-13-2013, 11:26 AM
  6. nested MATCH function within the INDEX function
    By thechoosenonesdream in forum Excel General
    Replies: 4
    Last Post: 10-25-2012, 03:55 PM
  7. Nested Function using MATCH and/or INDEX
    By ExcelJunkie in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-26-2006, 03:54 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