0

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?

1 Answer 1

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").

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

You must log in to answer this question.

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