Is there a method to convert these column in data format? (gg/mm/aaaa hh:mm:ss)
DATE : 20220601 >>>> 2022/06/01
HOUR : 3047 >>>>> 00:30:47 (hh:mm:ss)
I have serious problem with column B, i need to convert it in (hh:mm:ss). Someone can help me?
The final result should be "01/06/2022 00:30:47"
If you have Excel 365 you can use this formula:
=LET(HourText,TEXT(B2,"000000"),
DateText, A2,
HourFinal,TIME(LEFT(HourText,2),MID(HourText,3,2),RIGHT(HourText,2)),
DateFinal, DATE(LEFT(DateText,4),MID(DateText,5,2),RIGHT(DateText,2)),
DateFinal + HourFinal)
It first takes the text-hour and the text date.
Text hour is formatted as hhmmss - to have the zeros for hour if missing. Then it is easier to return the true hour.
Adding both values (date + hour (yes this is mathematical addition) returns the date.
You can then format the date as you like, e.g. as dd/mm/yyyy hh:mm.ss
Try-
=TEXTJOIN("/",TRUE,MID(A1,{1,5,7},{4,2,2})) & " " & TEXTJOIN(":",TRUE,MID(RIGHT("00"&B1,6),{1,3,5},{2,2,2}))
For pure date value use below function then use cell format to show your desired date/time format.
=DATEVALUE(TEXTJOIN("/",TRUE,MID(A1,{1,5,7},{4,2,2})))+TIMEVALUE(TEXTJOIN(":",TRUE,MID(RIGHT("00"&B1,6),{1,3,5},{2,2,2})))
Here is an easy alternative solution, using the TEXT() Function with a Custom Formatting for Dates 0000\/00\/00 while for Times 00\:00\:00
• Formula used in cell C2
=TEXT(A2,"0000\/00\/00")+TEXT(B2,"00\:00\:00")
So, the first part of the TEXT() function returns & converts the Numbers into Dates, while the second part returns & converts the Numbers into Times, and as we know that Dates & Times are stored as Numbers in Excel, so the Integer part which represents the Dates and the Decimal which represents Times, when added to together returns a Number with Decimals using the TEXT() Function.
Hence if the cells are not formatted before then please select the cell or range and press CTRL+1 --> Format cells Dialogue Opens --> Number Tab --> Category --> Custom --> and type by removing General as dd/mm/yyyy hh:mm:ss or as per your region it will be gg/mm/aaaa hh:mm:ss
Note: For more inspiration on converting Dates when shown like those numbers, you can refer this link, I have shared a whole lot of alternatives.
CHANGE THE DATE FORMAT
I would like to filter my data in spotfire using a date range formula, like this Date > '2020-05-01'
May i know how to write this date rangr using spotfire formula?
The correct syntax would be : [ColumnName] > Date('2020-05-01) This will take your string of '2020-05-01' and convert it to a date which can be used to compare to your date column. This can be used in data limiting expressions in a visual , calculated column or anywhere else an expression can be used.
I have a formula to convert a date in an excel column
=CONCATENATE(YEAR([#[Admission Date]]),"-",MONTH([#[Admission Date]]))
It produces a date like this "2014-1." For sorting purposes I need the date to look like this "2014-02" Is there a way to write that into the formula?
Thanks
Try,
=DATE(YEAR([#[Admission Date]]), MONTH([#[Admission Date]]), 1)
' as strictly text (not recommended)
=TEXT([#[Admission Date]], "yyyy-mm")
Format the column as yyyy-mm. Always work with real numbers and real dates whenever you can. There is more than enough variations available with Number Format Code to make it look like you want while rtaining an underlying numerical value.
This should be simple enough if you add an "if" statement so that it will add a "0" before the number if it's < 10
=CONCATENATE(YEAR(A1),"-",IF(MONTH(B1)>10,MONTH(B1),CONCATENATE("0",MONTH(B1))))
The logic behind it is: if "b1 > 10" then (leave it as is) else concatenate("0",month(b1))
I'm trying to match a date against an array. However, I notice my date is evaluated as an integer.
Instead of =MATCH(20/02/2014;B1:B21;1) it becomes =MATCH(41690;B1:B21;1); and I'm getting an #N/A as a result!
How to get this rectified?
Thanks!
Make sure that dates in your lookup column are actually dates (i.e. 5-digit decimal values in fact, but not text).
Use a formula like this:
=MATCH(DATE(2014,2,20),B1:B21,1)
This is because your lookup range is not formatted as Date, because in whatever format you write a date (dd/mm/yy or mm/dd/yy or yy/dd/mm) dates should match if written as date.
Currently I exported some data, from a database using a query in which each row for a "comment" column begins with a date formatted as MM/DD/YY.
I used the =LEFT(TEXT,8) function to only extract the date but it happens that the some of the dates are formatted inconsistently so we may have some that are M/D/YY where the month or day isn't two digits, this will then include a ';' as a separator since it is less than 8 characters.
Is there a way I can format the text so the ';' is excluded? That way I can sort the data.
I think the DATEVALUE function does most of what you need. It takes in many different date formats (M/D/YYYY, MM/DD/YYYY etc) and converts it to an excel date (i.e. # of days since 1/1/1900).
The formula below says:
If the date is clean then just apply DATEVALUE function
If there is an error, just use the part to the left of the ';'
Assuming 9/1/2013 is Cell A2:
Input Data Sortable Excel Date
---------- -------------------
9/1/2013; =IFERROR(DATEVALUE(A2),DATEVALUE(LEFT(A2,FIND(";",A2)-1)))
09/2/2013; 9/2/2013
10/1/2013; 10/1/2013
10/10/2013 10/10/2013
I've made a live Excel sample here.
Assuming your text looks like this: ;1/;2/13 or 1/2/13;; or ;;1/2/13
You can use substitute like this:
=SUBSTITUTE(A1,";","")
The result will be:
So if date is either the first 6, 7 or 8 characters of A2 you can get the date with this formula
=LOOKUP(10^10,LEFT(A2,{6,7,8})+0)
format result cell in required date format
As the result is a valid date you can sort these as you would sort numbers