Cell value string to Int in OpenOffice Calc?

1

1

I have "1 hour", "2 hours", in a column in Calc, and I would like to extract the numbers only. I've tried VALUE(A9), but it doesn't work.

Michael

Posted 2011-07-26T02:58:09.697

Reputation: 165

Answers

4

This is an Excel solution but my understanding is that Calc supports most Excel functions.

If your number always appears at the beginning of a text string and is followed by at least one space, then:

=VALUE(LEFT(A1,SEARCH(" ",A1)-1))

will extract the value from such a string in cell A1.

Mike Fitzpatrick

Posted 2011-07-26T02:58:09.697

Reputation: 15 062

3=VALUE(LEFT(A1;SEARCH(" ";A1)-1)) +1. – Prince John Wesley – 2011-07-26T04:06:36.733