ronan
ronan

Reputation: 4672

Discard apart of a string after DOT . using excel formula

I have the following column value in B4 in tab 1 i.e 2014-07-01 01:55:58.717286-05 out of which discard portion .717286-05 and copy only 2014-07-01 01:55:58 using excel formula to another tab on excel

The formula Im using it =INDIRECT("tab3!B4") Please suggest a way to discard value that comes after a . like (.717286-05) for example out of 2014-07-01 01:55:58.717286-05 copy only 2014-07-01 01:55:58 How to achieve this using excel formula ?

Upvotes: 0

Views: 161

Answers (2)

L42
L42

Reputation: 19737

Suppose you have your sample value in sheet named tab3 on cell B4, use below formula:

=LEFT(tab3!B4,SEARCH(".",tab3!B4)-1)

Above assumes there's only one dot and returns value as text.

Edit1:
If you want to return it in date format:

=ABS(LEFT(tab3!B4,SEARCH(".",tab3!B4)-1))

Upvotes: 1

Danielle
Danielle

Reputation: 317

=TEXT(tab3!B4, "yyyy-mm-dd hh:mm:ss")

Upvotes: 1

Related Questions