+ Reply to Thread
Results 1 to 4 of 4

Lookup function needed?

  1. #1
    Registered User
    Join Date
    09-09-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    45

    Lookup function needed?

    Hi guys,

    This is an odd one, I hope you can help with. I'm not sure if it needs a lookup code or what...

    See attached spreadsheet.

    In the column 'serial no', we can get any number of different results, but these always start with a two or three letters, which I have a list of - there's only about ten different possibilities (i./e. VC, DAF, CN etc etc). The digits that follow these two/three letters are always whole integers, which just progress sequentially, as in the example attached.

    What I need is a cell (to the side of the main data), which shows the last VC, DAF, CN number in the list... i.e. in the attachment, for VCs we've got up to VC442168, and for CNs we've also got up to CN510240. So I'd like to be able to make a box which in logical steps goes something like; Look in column C, for codes beginning with VC, look for last instance of this VC in the column, and display this in cell L39 (for example, could be any cell I choose). If the code was working correctly for VCs, it would display VC442168 in cell L39.

    I'd then want to do a similar code for DAF, CN, etc etc, but this will produce in a separate box (i.e. L40, L41, L42), so I'll just copy the code above replacing the letters with DAF instead of VC, and so on and so forth.

    Is there a way of getting it to do this?


    thanks for your help!

    Km
    Attached Files Attached Files

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Lookup function needed?

    Given you always want the last instance (ie always listed in Desc order) then I would suggest:

    K39: VC
    K40: DAF
    K41: CN

    then

    L39: =LOOKUP(2,1/(LEFT($C$4:$C$100,LEN($K39))=$K39),$C$4:$C$100)
    copied down to L41

    Adjust ranges as necessary.

    Of course if the codes are not mutually exclusive the above will not work... eg codes DA and DAF would be open to error.

  3. #3
    Registered User
    Join Date
    09-09-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Lookup function needed?

    That, is, amazing. Better answer than I was expecting. Thank you!

  4. #4
    Registered User
    Join Date
    09-09-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Lookup function needed?

    Thankfully that won't matter - the first letter stays the same for a looooong time, years, and the second/third letters don't matter so much as the first letter is the one which defines what that serial number is in respect of. So this will work perfectly for my purposes.

+ 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