Extracting characters from a cell into another one

Discuss the spreadsheet application
Post Reply
jarmilavdw
Posts: 1
Joined: Fri May 16, 2008 11:24 am

Extracting characters from a cell into another one

Post by jarmilavdw »

Hi,

Would anybody know how to do the above? Let's say in cell A1 I have the following: '00:15:26' and I need to extract the last 2 characters. Normally in Microsoft Excel I would use the following formula: =right(A1,2). Would anybode know how to do it in Open Office as I have given up on searching for it in Open Office help.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: EXTRACTING CHARACTERS FROM A CELL INTO ANOTHER ONE

Post by Villeroy »

If the value is a literal text, then RIGHT will return the last characters. Since your time value seem to be a formatted number, RIGHT will return the last digits of that number.
What you want to get (although you did not tell us) seems to be =SECOND(A1).
All dates and times are formatted numbers. You can format any number as date and/or time. For demonstration purposes, try =PI() with number format "YYYY-MM-DD HH:MM:SS".
or try a sequence like:
-1
-0.75
-0.5
-0.25
0
0.25
...some dozends or rows...
and format as date/time "YYYY-MM-DD HH:MM:SS".
This enshures that you can calculate easily with dates and times as numbers in unit "Days".
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply