+ Reply to Thread
Results 1 to 17 of 17

What function do I need? or what am I doing wrong? VLOOKUP? MATCH? or maybe INDEX?

  1. #1
    Registered User
    Join Date
    12-11-2014
    Location
    Gävleborg, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    13

    What function do I need? or what am I doing wrong? VLOOKUP? MATCH? or maybe INDEX?

    Hi, I have this file (an attached example), and I'm trying to make a search function that returns the value to the left (column B) of the search column (column C) match. But why can't I get any returned value from my function? It seems that if a match is found it returns "#REF!", and if no match is found it returns "#N/A", but no value. In cell F3 the search term is entered, and in cell G3 I have entered the function that depends on F3. Does someone know how I can fix this? What function? I'm a total newbe, and my english isn't perfect either but I hope someone may understand what I am trying to do anyway.. Thanks in advance.
    /Axel
    example.xlsx

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,099

    Re: What function do I need? or what am I doing wrong? VLOOKUP? MATCH? or maybe INDEX?

    Hi. The problem was that (unless you fiddle with it extensively) VLOOKUP doesn't run from R to L. INDEX-MATCH does. Try this:

    =INDEX($B$2:$B$11,MATCH(F3,$C$2:$C$11,0))
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    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: What function do I need? or what am I doing wrong? VLOOKUP? MATCH? or maybe INDEX?

    Try this

    =LOOKUP(10^308,SEARCH(F3,C2:C11),B2:B11)
    Last edited by AlKey; 01-26-2015 at 10:45 AM.
    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

  4. #4
    Registered User
    Join Date
    12-11-2014
    Location
    Gävleborg, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: What function do I need? or what am I doing wrong? VLOOKUP? MATCH? or maybe INDEX?

    Quote Originally Posted by Glenn Kennedy View Post
    Hi. The problem was that (unless you fiddle with it extensively) VLOOKUP doesn't run from R to L. INDEX-MATCH does. Try this:

    =INDEX($B$2:$B$11,MATCH(F3,$C$2:$C$11,0))
    I tried that function but it doesn't work when I search for example "604", but thank you anyway Think I have solved it now

  5. #5
    Registered User
    Join Date
    12-11-2014
    Location
    Gävleborg, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: What function do I need? or what am I doing wrong? VLOOKUP? MATCH? or maybe INDEX?

    Quote Originally Posted by AlKey View Post
    Try this

    =LOOKUP(10^308,SEARCH(F3,C2:C11),B2:B11)
    Thank you so much, this works really well! So I have pasted it in my real document now and it work´s brilliant, but there is one thing I'm woundering; why "10^308"? I know it works but I am just curious

  6. #6
    Registered User
    Join Date
    12-11-2014
    Location
    Gävleborg, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: What function do I need? or what am I doing wrong? VLOOKUP? MATCH? or maybe INDEX?

    Quote Originally Posted by AlKey View Post
    Try this

    =LOOKUP(10^308,SEARCH(F3,C2:C11),B2:B11)
    Hi again, there is one more thing, with this function, if I have not entered anything in F3, it returns the last entry in column B, is it possible to make it return nothing (blank), or maybe a "N/A"?
    Thanks

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,099

    Re: What function do I need? or what am I doing wrong? VLOOKUP? MATCH? or maybe INDEX?

    Thanks for the feedback - I didn't notice the multiple values for one entry in column B. WRT your last request - that's easy

    =IF(F3="","",LOOKUP(10^308,SEARCH(F3,C2:C11),B2:B11))

  8. #8
    Registered User
    Join Date
    12-11-2014
    Location
    Gävleborg, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: What function do I need? or what am I doing wrong? VLOOKUP? MATCH? or maybe INDEX?

    Quote Originally Posted by Glenn Kennedy View Post
    Thanks for the feedback - I didn't notice the multiple values for one entry in column B. WRT your last request - that's easy

    =IF(F3="","",LOOKUP(10^308,SEARCH(F3,C2:C11),B2:B11))
    Okay so I am using this now, thanks. I found an situation in my original document (can't upload for safety reasons) when there are multiple matches. In this function it returns one match, is it possible to ad something to the function that makes it return all matches, like; "604, 534, special"?
    Thank you

  9. #9
    Registered User
    Join Date
    12-11-2014
    Location
    Gävleborg, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: What function do I need? or what am I doing wrong? VLOOKUP? MATCH? or maybe INDEX?

    Quote Originally Posted by Glenn Kennedy View Post
    Thanks for the feedback - I didn't notice the multiple values for one entry in column B. WRT your last request - that's easy

    =IF(F3="","",LOOKUP(10^308,SEARCH(F3,C2:C11),B2:B11))
    Okay so I am using this now, thanks. I found an situation in my original document (can't upload for safety reasons) when there are multiple matches. In this function it returns only one match, is it possible to ad something to the function that makes it return all matches, like; "604, 534, special"?
    Thank you

  10. #10
    Registered User
    Join Date
    12-11-2014
    Location
    Gävleborg, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: What function do I need? or what am I doing wrong? VLOOKUP? MATCH? or maybe INDEX?

    Quote Originally Posted by Glenn Kennedy View Post
    Thanks for the feedback - I didn't notice the multiple values for one entry in column B. WRT your last request - that's easy

    =IF(F3="","",LOOKUP(10^308,SEARCH(F3,C2:C11),B2:B11))
    Okay so I am using this now, thanks. I found an situation in my original document (can't upload for safety reasons) when there are multiple matches. In this function it returns only one match, is it possible to ad something to the function that makes it return all matches, like; "604, 534, special"?
    Thank you

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,099

    Re: What function do I need? or what am I doing wrong? VLOOKUP? MATCH? or maybe INDEX?

    Where are the multiple matches, in the number column (a new requirement) or in the document column (already covered by your original post)? I'm not clear as to which eventuality you're tryig to cover...

  12. #12
    Registered User
    Join Date
    12-11-2014
    Location
    Gävleborg, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: What function do I need? or what am I doing wrong? VLOOKUP? MATCH? or maybe INDEX?

    Quote Originally Posted by Glenn Kennedy View Post
    Where are the multiple matches, in the number column (a new requirement) or in the document column (already covered by your original post)? I'm not clear as to which eventuality you're tryig to cover...
    In the number column, i posted the example file again but with new functions and longer list with multiple matches. I left a comment in the function cell. Sorry for compicating things.. :Pexample.xlsx

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,099

    Re: What function do I need? or what am I doing wrong? VLOOKUP? MATCH? or maybe INDEX?

    Try htis. It's a bit clunky, but it works for your examples.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    12-11-2014
    Location
    Gävleborg, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: What function do I need? or what am I doing wrong? VLOOKUP? MATCH? or maybe INDEX?

    Quote Originally Posted by Glenn Kennedy View Post
    Try htis. It's a bit clunky, but it works for your examples.
    Okay thank you it seems perfect! Now I just have to modify it a little bit to make it work with the real document! Once again thank you so much, you've helped me a lot!

  15. #15
    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: What function do I need? or what am I doing wrong? VLOOKUP? MATCH? or maybe INDEX?

    Hi accelgronvall,

    If you have multiple values to return use this array formula

    =IFERROR(IF($F3>0,INDEX($B:$B,SMALL(IF(ISNUMBER(SEARCH($F3,$C2:$C13)),ROW($C2:$C13)),COLUMNS($G:G))),""),"")

    ***Array formula must be entered by using key combination of CTRL+SHIFT+ENTER and not just ENTER

  16. #16
    Registered User
    Join Date
    12-11-2014
    Location
    Gävleborg, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: What function do I need? or what am I doing wrong? VLOOKUP? MATCH? or maybe INDEX?

    Quote Originally Posted by AlKey View Post
    Hi accelgronvall,

    If you have multiple values to return use this array formula

    =IFERROR(IF($F3>0,INDEX($B:$B,SMALL(IF(ISNUMBER(SEARCH($F3,$C2:$C13)),ROW($C2:$C13)),COLUMNS($G:G))),""),"")

    ***Array formula must be entered by using key combination of CTRL+SHIFT+ENTER and not just ENTER
    When I'm trying to use this formula it only gives me one result?

  17. #17
    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: What function do I need? or what am I doing wrong? VLOOKUP? MATCH? or maybe INDEX?

    You have to enter formula with Ctrl+Shift+Enter

    Please see attached file
    Attached Files Attached Files

+ 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] Vlookup or Index Match Function?
    By koolkuldip in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-31-2014, 03:17 AM
  2. [SOLVED] Vlookup or Index match function
    By sonu1975 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-18-2014, 05:52 AM
  3. [SOLVED] Index + Match + IF - Function - Wonder why Excel Kept Refer to The Wrong Want
    By cychua in forum Excel Formulas & Functions
    Replies: 25
    Last Post: 06-29-2014, 06:32 AM
  4. vlookup vs Index match function
    By ladyv in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-20-2013, 01:29 AM
  5. Function Vlookup, Match or Index?
    By Patrick Young in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-03-2005, 07:05 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