ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date conversion (https://www.excelbanter.com/excel-programming/455096-date-conversion.html)

programmernovice[_2_]

Date conversion
 
I'm wanting to convert a date to a related symbol string.

Example: 7/16/21 to "210716"

12/17/21 to "212217"
Note that when month has a single digit, a "0" must be added before it in the string.

Can't figure out how to do it using Excel functions. Any ideas would be greatly appreciated.

Claus Busch

Date conversion
 
Hi,

Am Mon, 5 Apr 2021 14:28:14 -0700 (PDT) schrieb programmernovice:

I'm wanting to convert a date to a related symbol string.

Example: 7/16/21 to "210716"

12/17/21 to "212217"
Note that when month has a single digit, a "0" must be added before it in the string.


try:
=RIGHT(YEAR(A1),2)&TEXT(MONTH(A1),"00")& TEXT(DAY(A1),"00")

Regards
Claus B.
--
Windows10
Microsoft 365 for business

programmernovice[_2_]

Date conversion
 

try:
=RIGHT(YEAR(A1),2)&TEXT(MONTH(A1),"00")& TEXT(DAY(A1),"00")




Perfect! Many thanks for your help, Klaus. If memory serves, you've always been helpful to me and I appreciate it.


All times are GMT +1. The time now is 02:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com