# Thread: get last two values from column

1. Registered User
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??

2. www.gvee.co.uk
Join Date
Jan 2007
Location
UK
Posts
11,445
Provided Answers: 12
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.

3. Registered User
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)

4. www.gvee.co.uk
Join Date
Jan 2007
Location
UK
Posts
11,445
Provided Answers: 12
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

5. Registered User
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.

6. Registered User
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.

#### Posting Permissions

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