Ask Your Question

Reverse value: "07-03-2014" to "2014-03-07

asked 2016-11-29 02:35:38 +0200

firewater gravatar image

The values are all in different rows in the same column.

Find and replace wouldn't work because it's many values like this that I want to reverse ("05-02-2013", "12-12-2012", etc).

edit retag flag offensive close merge delete


Are you sure "07" was "DD" in your example "07-03-2014" from the subject line? Concerning the USA I would even be afraid someone placed "MM" first.

Lupp gravatar imageLupp ( 2016-11-29 10:19:55 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2016-11-29 03:43:03 +0200

mikebibo gravatar image

updated 2016-11-29 03:47:17 +0200

Find and replace should work, with regular expressions.

In the find and replace dialogue, under other options, make sure regular expressions is checked.

Then search for: ([0-9]{2})-+([0-9]{2})-+([0-9]{4})

and replace with: $3-$2-$1

This searches for a pattern of two digits, a dash, two digits, a dash, and four digits. It then simply reverses the order of the components. See for more detail.

It worked for a simple example in both a text document and a spreadsheet, but it is not extensively tested. Someone with greater skills in using regular expressions may be able to improve on this. Hope it helps.

edit flag offensive delete link more


Thank you very much for the fast response! It worked perfectly.

firewater gravatar imagefirewater ( 2016-11-29 04:09:31 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-11-29 02:35:38 +0200

Seen: 24 times

Last updated: Nov 29 '16