Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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
Try TEXT(INT(cell), "dd/mm/yyyy"). – Excellll Oct 11 '11 at 17:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .