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 a cell that holds a date/time value in the following format: dd/mm/yyyy hh:mm.

Now I need to extract the date from it as a string and append a different time to it. And I need the final result as a string. What's the best way to do this?

share|improve this question

1 Answer 1

If stored as a Date then you can use int() to remove the time part of the date value and then add another time part. If stored as text then use left(cell, 10) to obtain just the dd/mm/yyyy part. You can convert dates to strings using text(cell, "dd/mm/yyyy") etc, and you can convert strings to dates using datevalue ("dd/mm/yyyy").

share|improve this answer
    
basiclaly if the text has 01/07/2011 09:30, I basically need 01/07/2011 as a string or a text. If i do TEXT(cell, dd/mm/yyyy hh:mm) I dont get it. –  AMM Oct 11 '11 at 15:24
2  
Try TEXT(INT(cell), "dd/mm/yyyy"). –  Excellll Oct 11 '11 at 17:06

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.