If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > get last two values from column

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-08-07, 08:37
Kabuki_jo Kabuki_jo is offline
Registered User
 
Join Date: Oct 2003
Posts: 61
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!
Reply With Quote
  #2 (permalink)  
Old 05-08-07, 08:49
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
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
Twitter | Blog
Reply With Quote
  #3 (permalink)  
Old 05-08-07, 09:30
Kabuki_jo Kabuki_jo is offline
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)
__________________
Nobody dies a virgin because life screws us all!
Reply With Quote
  #4 (permalink)  
Old 05-08-07, 09:36
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
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
Twitter | Blog
Reply With Quote
  #5 (permalink)  
Old 05-09-07, 13:39
shades shades is offline
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.
__________________
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

Last edited by shades; 05-09-07 at 17:17.
Reply With Quote
  #6 (permalink)  
Old 05-09-07, 15:36
shades shades is offline
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.
__________________
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

Last edited by shades; 05-09-07 at 17:17.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On