1

When importing data from Magento to Google Sheets, the date of each transaction is in text format.

For example:

1.1.2020 14.54.16

31.12.2019 16.17.32

How can I format the date part into value? The time of the day should be eliminated.

Desired output:

43830

43831

Test sheet here: https://docs.google.com/spreadsheets/d/1IyGzzrWQMeM-FbV3TVBl23V0NTKq7aWfuf88DKnQwwQ/edit?usp=sharing

3
  • what do the numbers in the desired output represent Commented Jan 9, 2020 at 14:44
  • Numerical value of the date. Commented Jan 9, 2020 at 15:05
  • how to get from 1.1.2020 to 43830? Commented Jan 9, 2020 at 15:10

1 Answer 1

2

1) The Time component can be extracted using REGEXTRACT function, as I have placed it in the test sheet

=REGEXEXTRACT(A2, "(\d{1,2}\.\d{1,2}.\d{4,4})")

2)replace . with *

=SUBSTITUTE(B2,".","*")

3)Split on *

=SPLIT(C2,"*")

4)Create Date Object

=DATE(F2, E2, D2)

5)Convert to Numerical

=DATEVALUE(G2)
Sign up to request clarification or add additional context in comments.

4 Comments

Hi Ian! Thanks for the input. However, that's not what I'm trying to achieve. Your suggestion is in a text format and that is what I'm trying to get rid of. The output should be in a number format because that's how I'd able to change it to any date format (e.g. YYYY-MM-DD or DD-MM-YYYY) I prefer.
so you want to make a date object from the text is that correct?
Try edited solution. See test sheet. Although I still don't understand google's numerical value of date :P
As a pointer, Google's numerical value of a date is computed as the number of days starting on 1900-1-1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.