Google Sheets - Date Format Display Issues - date

I'm currently building dashboards in Google Sheets and have run into a consistent issue with dates being displayed as a number opposed to a date format. EX: 43626 opposed to 6/11/19.
This data is being pulled from form sheet into a database, then queried into the dashboard spreadsheet where it is coming through as a number sequence opposed to readable date format. Currently have tried to use the DATEVALUE to reformat, as well as attempted to reformat the cell into a date format in both dashboard and database locations, with no luck.
//What I've tried
=TargetCell
43626
=DATEVALUE(TargetCell)
43626
=TargetCell //Reformatted as any Date format
43626
I was expecting the following
=DATEVALUE(TargetCell)
6/11/19
OR:
=TargetCell //Reformatted as any Date format
6/11/19

you got it wrong... function DATEVALUE creates 43626 from 6/11/2019
if you want to reverse it you need to use either:
internal custom date formatting (does not work all the times)
TEXT formula like: =TEXT(43626, "m/d/yy")
QUERY parameter format like: =QUERY(A:B, "format A 'm/d/yy'", 0)
or QUERY parameter toDate like: =QUERY(A:B, "toDate(A)", 0)
https://developers.google.com/chart/interactive/docs/querylanguage#top_of_page

Related

Google sheets won't format time date correctly

My Google Sheets is currently set to UK London GMT
I have some data that is needed in UK format and other data that is needed in US format within the same sheet.
I'm using date time as dd-mm-yyyy hh:mm:ss and have been trying to convert this to US yyyy-mm-dd hh:mm:ss
When formatting the UK date time to as text and using this formula
=ARRAYFORMULA(REGEXREPLACE(A2:A, "(\d{4})-(\d+)-(\d+)", "$3/$2/$1"))
It should be converting for me however is stays the same.
I have also tried simply copying and pasting in a new column with the intention of changing format from within formatting settings but when pasting it seems to randomly select different formats in some rows using / instead of - and in other rows returning a number instead of date time.
How can I get this to work correctly?
try:
=TEXT(A2, "e-m-d h:mm:ss")

How to convert a field with 202008 to a date in Tableau

I am trying to convert a field that contains strings such as 202008, 202108 to a date field. I have tried the date() function, clicking on the measure and converting it to a date. I have also tried DATE(LEFT([Month],4)+"-"+RIGHT([Month],2)+"-01") but that will only return the year.
Using Tableau Desktop 2021.1, when I change the data type from String to Date, Tableau translates the strings to 8/1/2020 and 8/1/2021. If you are using an earlier version of Desktop, it is possible that this functionality is not present.
However, if changing the data type isn't working for you, the calculated field code you provided should actually work, you just need to change the date part from Year to Month/Day/Year using the Custom date part option.

Converting number to date format using Power Query Editor

I need help to convert Numbers into date format using Power Query Editor in either Excel or PowerBI
The date appears in number form like this 930101 and I want to convert it to normal Uk date format
Not sure which one is month and which one is date among "0101" in your string. But you can handle this your self and follow this below steps for get your required output in Power Query Editor-
First, split your string value using fixed 2 character and your data will be divide into 3 column now. define which one is Year, Month and Day.
Now, merge those 3 column maintain the UK pattern DD/MM/YY using a separator "/" and you will get a string like "01/01/93".
Finally, create a custom column using the below code-
Date.From([Merged],"en-GB")
Here is the final output-
In the above image, you can see the date in still US format just because of my Laptop's locally setup.

Format to enter a Date in Google Forms

I have a drop-down list of dates I want users of a form to select from. I have tried mm/dd//yy, mm/dd/yyyy, yyyy-mm-dd, yyyy/mm/dd and MMM-DD-YYY, but the data that ends up in the Sheet is always 12/31/1969 (25568.6666666667 if I change the display format). What format can I use to get a date successfully imported?
The answer in this thread didn't work for me: What format is required to import a date into google spreadsheet
The format mm/dd/yyyy works; I had a problem in the naming of the columns of the spreadsheet which was the source of the problem.

Convert Date Value When Using Google Form Date Picker from 5 Digit Format to MM/dd/yyyy format

I selected tomorrow's date (8/21/2014) from the data picker field of a Google Form submission, and the value "41872" is returned in the spreadsheet.
What format is this date format?
I need to convert this date format to the MM/dd/yyyy format using script, as formatting the Date column using the Format menu only updates the rows that are currently available...not the new rows that will be there when new form submissions come in.
How do I make this conversion?
I am not sure, but your issue seems to be very basic. Its about the cell formatting as like we do in Ms Excel.
For Google spreadsheet inorder to format a cell or a range,
1. Select the Range
2. On menu, Go To Format->Number->Date (and then select the required format)
Does this works?
I had the same confusion. All you need to do is just change the format from the menu Format->Number->Date & Time