+ Reply to Thread
Results 1 to 10 of 10

Need help with LOOKUP or INDEX/MATCH formula

  1. #1
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Need help with LOOKUP or INDEX/MATCH formula

    I have used VLOOKUP and even INDEX/MATCH successfully before, but every new worksheet presents a little variation - and my project today is throwing me off just a bit...

    I have 6 columns of data in A - F. Column B (about 3,000 rows) contains a 3-digit numeric code. There are 100 different codes (from 001 thru 100), each with a different description, but the description is not in the data set. So I inserted my 'key' in columns J2:K101, with column J (J2:J101) containing the text description, and column K (K2:K101) with the 3-digit numeric codes (in order 001-100, the codes in column B are not sorted in order.).

    So my formula in my next column (G), needs to look at the code in column B, find it in column K, and return the value in column J. Should be easy enough - but it's giving me fits.

    Sorry, no workbook - because I think this is fairly straight forward - but if anyone wants to help and really needs me to upload an example, let me know. Thanks!

    -HeyInKy
    Last edited by HeyInKy; 04-30-2014 at 11:22 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Trying to learn LOOKUP (INDEX, MATCH?) ...Grrr...

    It will be index and match

    =INDEX($A$1:$F$3000,match($B1,$K$1:$K$3000,0),10)

    Not tested.
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Trying to learn LOOKUP (INDEX, MATCH?) ...Grrr...

    If you put the code in J and the description in K, you could have used VLOOKUP
    =VLOOKUP(B2, $J$2:$K$101,2, FALSE)

    with the code in K
    =INDEX($K$2:$K$101, MATCH(B2, $J$2:$J$101,0))
    or
    =LOOKUP(B2, $K$2:$K$101, $J$2:$J$101)
    Does that help?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Trying to learn LOOKUP (INDEX, MATCH?) ...Grrr...

    Please Login or Register  to view this content.
    Like that?

    Find the position in column K of what matches the entry in the same row of B column, and then return what's sitting in J column into the G row.

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Trying to learn LOOKUP (INDEX, MATCH?) ...Grrr...

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

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

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  6. #6
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Re: Trying to learn LOOKUP (INDEX, MATCH?) ...Grrr...

    Thanks all for your suggestions and help. Just FYI, nathansav's returned #N/A, as did ChemistB's INDEX array... however the simple LOOKUP formula worked great, as did ben_hensel's INDEX array formula. Thanks again!

    -HeyInKy

  7. #7
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Need help with LOOKUP or INDEX/MATCH formula

    Yes, put the formula in backwards

    with the code in K
    =INDEX($K$2:$K$101, MATCH(B2, $J$2:$J$101,0))
    should be
    =INDEX($J$2:$J$101, MATCH(B2, $K$2:$K$101,0))

  8. #8
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Re: Need help with LOOKUP or INDEX/MATCH formula

    Ok... this is weird and you may not have an explanation. The formulas worked fine. But I had it on sheet1. I have duplicate-formatted data on sheet3, and decided to move my key to there as well. So my formula on sheet1 is:

    =INDEX(Sheet3!$J$2:$J$121,MATCH(B2,Sheet3!$K$2:$K$121,0))

    Works great. But when I try to enter either of the formulas in column G on sheet3, I get #N/A (Ref error)... for the life of me I can't figure out why it's doing that. The data in column B is identical (in format) to column B on sheet1. Without me uploading the workbook (I would have a lot of data to sanitize), what could be causing this? Both formulas are pointing to the same key!

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Need help with LOOKUP or INDEX/MATCH formula

    Where is the B2, you are trying to match against? If it's on sheet1, then you need to add that to the formula when putting it into Col G of Sheet3

  10. #10
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Re: Need help with LOOKUP or INDEX/MATCH formula

    I've discovered the problem...column B on Sheet3 is NOT formatted the same. But excel is not recognizing it as a number even though it's formatted as a number. So I'll figure it out. Thanks again!!

+ 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. Replies: 6
    Last Post: 04-30-2014, 02:42 AM
  2. Replies: 3
    Last Post: 06-17-2013, 12:37 PM
  3. Match/Index/Lookup - Searching From Bottom to Top (A reverse lookup maybe)
    By Neutralizer in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-02-2013, 03:55 AM
  4. Replies: 7
    Last Post: 06-19-2011, 12:51 PM
  5. Using Lookup instead of Index/Match for left lookup
    By teylyn in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-07-2008, 09:20 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