+ Reply to Thread
Results 1 to 5 of 5

Matrix searching

  1. #1
    Registered User
    Join Date
    09-12-2007
    Posts
    9

    Matrix searching

    Let's say I have the following matrix:

    Start End Letter
    1 5 a
    6 9 b
    10 19 c
    20 24 d


    how can I automatically show the letter that's between certain numbers?

    For instance, I type in number 14... Since it's between 10 and 19, it should show the letter "C"!

    THANX!

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Say you enter 14 in D1 enter the below formula in say E1

    =LOOKUP(D1,{1,6,10,20},{"a","b","c","d"})

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    09-12-2007
    Posts
    9
    Thanx for the quick answer.

    However, in your example, I must type in the matrix, right? I can't simply select the cases and he'll do automatically even if I change the original matrix, right?

    Thanx!

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    =INDEX(C2:C5,MATCH(D1,A2:A5,1))

    VBA Noob

  5. #5
    Registered User
    Join Date
    09-12-2007
    Posts
    9
    Worked like a charm!!!!!!

    thanx

+ 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