Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
3  
=VALUE(LEFT(A1;SEARCH(" ";A1)-1)) +1. –  Prince John Wesley Jul 26 '11 at 4:06
    
Thanks, guys! Works! –  Michael Jul 26 '11 at 4:20
    
Thanks @John, for the correct Calc syntax. –  Mike Fitzpatrick Jul 26 '11 at 4:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.