Convert date in A2 to dd-mm-yyyy in C2

Muthukrishnan V

Active Member
Joined
May 29, 2008
Messages
294
Office Version
  1. 365
Platform
  1. Windows
Convert date in A2 to dd-mm-yyyy format in C2.xlsx
ABCDEF
1DateTo convert :Excel 365
22/26/200826-02-2008Request formula to
3convert A2 to
4dd-mm-yyyy in C2.
5
6How to find how A2
7is formatted as text
8or date?
Sheet1
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Does this work for you? Use the formula shown and format the formula column with the data format you want.

24 04 02.xlsm
ABC
1DateTo convert :
22/26/200826-02-2008
Convert Date
Cell Formulas
RangeFormula
C2C2=--TEXTJOIN("-",,INDEX(TEXTSPLIT(A2,"/"),{2,1,3}))
 
Upvote 0
Solution
2 for text, 1 for date.

工作簿1
ABCDEF
1DateTo convert :Excel 365
22/26/20082Request formula to
32024-4-21convert A2 to
4dd-mm-yyyy in C2.
5
6How to find how A2
7is formatted as text
8or date?
Sheet1
Cell Formulas
RangeFormula
C2:C3C2=TYPE(A2)
 
Upvote 0
Another way to find whether A2 (or column A) is being recognised by Excel as being text or date:-
• Change the format of column. Pick something that is glaringly obvious ie General (which would show a number for dates)
Anything that changes is a date anything that doesn't is text.
• Then ctrl+z to restore the format.
 
Upvote 0
To convert date to text:
Excel Formula:
=TEXT(C2,"dd-mm-yyyy")
Converting date to text loses the date information. If you have a date and you only want to change the way it is displayed use Number formatting:
1712042025256.png
(for Date or Custom)

One way to distinguish btw text and Date/Number is the Type function, as shown above by shaowu459
Easier and quick: if you have not manually applied any text alignment to cells then: text is shown as left aligned, numbers and dates/times - as right aligned, logical as centered
1712042336062.png
 
Upvote 0
You are welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,310
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top