I have this Excel data:
Using this formula:
="select '"&J4&"_"&H4&"', DATE '"&K3&"', DATE '"&K4&"' union all"
I get:
But I need both dates in this format:
I bolded the format of date I need. Thanks!
Use Text formula:
Text(K3,"YYYY-MM-DD")
So &K3&
Becomes
&Text(K3,"YYYY-MM-DD")&
Do same for K4
Could you use the functions YEAR() MONTH() and DAY() then put them in the format you want?
If k3 has the date, then YEAR(k3) will give 2017 etc
Substitute &K3& for the following:
&SUBSTITUTE(K3,"/","-")&
Related
What formula should I try to use to convert date:
Cell A1 = 01/07/2018 00:02:05
to
07/01/2018
I'd just change the date format of the cell Format > Date and find that format, or enter mm/dd/yyyy as a custom format. If you absolutely must use a formula then use TEXT() like so:
=TEXT(DATE(2018,7,1),"mm/dd/yyyy")
The day is missing so it just needs to be first of the month so:
11/17 would be 11/01/2017
Is there a formula that can do this?
There is two approaches:
Set the Category type of the cell (in Format Cell) as Custom and define this format in Type field: mm/dd/yyyy
In case of the format cell is text (working with string)
Assuming the validate entered in cell A1, use below formula:
=LEFT(A1,2)&"/01/"&IF(LEN(A1)=8,2,20)&RIGHT(A1,2)
This is probably a stupid formula but it worked for me;
=DATE(100 + RIGHT(TEXT(A6,"MM/YY"),2),LEFT(TEXT(A6,"MM/YY"),2),1)
Try it out it takes the existing "MM/YY" format and converts it to a MM/DD/YYYY date using the date foromula =DATE(Year,Month,Day). It works if the date is in date format or text format.
I have some dates in my excel spreadsheet that have th,nd,st and rd in the string so I am currently struggling to convert them to a date format of dd/mm/yyyy.
How would I be able to do this using a formula?
28th April 2017 = 28/04/2017
Thanks
The text being in A1:
=DATEVALUE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"th",""),"st",""),"nd",""),"rd",""))
With a formula:
=--(LEFT(A1,MIN(SEARCH({"th","st","nd","rd"},A1 & "thstndrd"))-1)&" " & MID(A1,MIN(SEARCH({"th","st","nd","rd"},A1 & "thstndrd"))+3,LEN(A1)))
This is an array formula and needs to be confirmed with Ctrl-Shift-Enter.
Then format as dd/mm/yyyy
You could give a try with this formula as well,
=IF(ISNUMBER(VALUE(LEFT(A1,2))),TEXT(REPLACE(A1,3,2,""),"mm/dd/yyyy"),TEXT(REPLACE(A1,2,2,""),"mm/dd/yyyy"))
The formula finds the numeric value in first two places and formats the date accordingly. The advantage of this formula is, you can modify the mm/dd/yyyy format as per your needs. There would not be a necessity to change the format of the cell.
Can anyone help me with an excel formula or any alternate ways on how i can convert a date like 01/01/1994 into number output '01011994'; i found the reverse method of this but couldn't find the methods i require.
Thank you
If your date is in cell A1 then this formula will do the trick:
=TEXT(DAY(A1),"00")&TEXT(MONTH(A1),"00")&YEAR(A1)
The DAY/MONTH/YEAR function will extract the digits, and the TEXT function will put leading zeros in front of the DAY and MONTH if necessary.
Assuming your "01/01/1994" value is in A1, you can use this formula:
=RIGHT((DAY(A1) + 100); 2) & RIGHT((MONTH(A1) + 100); 2) & YEAR(A1)
If your date is today try the below Formula
=TEXT(TODAY(),"dmmyyyy")
If your date is in E7 then try the below Formula
=LEFT(E7,2)&MID(E7,4,2)&RIGHT(E7,4)
I have entered the date in the excel as 19.04.2015 but now I want the "." in these dates to be replaced with "/", so that the output should be 19/04/2015
Does anyone know the formula for this?
Tutorial to change the date format. The way you should do it is change the data type to date on fields with date then modify date display format.
With data in A1, in B1 enter:
=DATE(RIGHT(A1,4),MID(A1,4,2),LEFT(A1,2))
and apply the correct format to B1
You have to set the cell format to Custom Format using TT/MM/JJJJ