At 12:05 09/10/2012 +1300, Steve Edmonds wrote:
I have had a look, and before I go writing a macro I thought I would
check there is no easier solution. I want to return the part of a
string in a cell matched by a regular expression. I have strings in
cells that could be X12.4Y.2Z1.234 or any combination of any letter
followed by a number. I want to be able to return the number after a
specified letter, not hard in a regexp. I have not been able to
find an LO function to do this.
I'm not sure it is an "easier solution", but you could try:
=VALUE(LEFT(MID(Xn;SEARCH("#";Xn)+1;99);SEARCH("[^0-9.]";MID(Xn;SEARCH("#";Xn)+1;99))-1))
- where Xn is the cell containing your original string and #
represents your "specified letter".
Note that you need to ensure there is a tick at Tools | Options... |
LibreOffice Calc | Calculate | Enable regular expressions in formulas.
But there must be an easier way ...
I trust this helps.
Brian Barker
--
For unsubscribe instructions e-mail to: [email protected]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted