Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2003
    Posts
    61

    Unanswered: get last two values from column

    I have a spreadsheet with a column holding all resetrates of a floating loan which a are separated by the ; sign .
    A cell in this column could look like this

    5.054;4.661;4.034;3.486;3.313334;2.4551;2.18923

    For valuation purposes I need the last two resetrates to be in a separate column. Doing a text to columns is not an option since not all loans have an equal number of resetrates . Using the RIGHt and MID function also doesn't seem to be cutting it since the number digits of the resetrate is not always the same. Is there any other way in which i can pick up the last rate and the one before last and put them in separate columns by just using a formula??
    Nobody dies a virgin because life screws us all!

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I'd take a look at using the InStr function (if that works in Excel, most things don't)
    That'd be my starting point.
    George
    Home | Blog

  3. #3
    Join Date
    Oct 2003
    Posts
    61
    I forgot to mention that I also have a column telling me how many resets there are so I also already know how many semi column signs there are in a cell (number of resets -1)
    Nobody dies a virgin because life screws us all!

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    The InStr functions supports that methinks... If memory serves you can specify which instance of the match you want to return...
    InStr or SubStr are the ones to look at
    George
    Home | Blog

  5. #5
    Join Date
    Oct 2003
    Posts
    1,091
    Howdy. For a formula approach, assume your data is in cell C3, then use:

    =RIGHT(C3,LEN(C3)-FIND("*",SUBSTITUTE(C3,";","*",LEN(C3)-LEN(SUBSTITUTE(C3,";","")))))

    Note: this makes it a text value, not number.
    Last edited by shades; 05-09-07 at 18:17.
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  6. #6
    Join Date
    Oct 2003
    Posts
    1,091
    That formula would be for the last value. With a little ingenuity and the same formula, you can determine how to get the second last value.
    Last edited by shades; 05-09-07 at 18:17.
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •