2

Suppose, in Excel, I have cell value equal to

"2020 Aug ABC"

I want to convert this to 202008 date format using an excel formula because I would want to use the output value, that is, 202008 to perform some operation.

ZygD
  • 22,092
  • 39
  • 79
  • 102
royalewithcheese
  • 402
  • 4
  • 17

5 Answers5

2

If your data is in A1:

=LEFT(A1,4) & TEXT((DATEVALUE(MID(A1,6,3) & " 1")),"mm")
ZygD
  • 22,092
  • 39
  • 79
  • 102
1
  • Import "2020 Aug ABC" in cell A1
  • Select A1 - Go to Data tab - Data Tools Area - Press Text to Columns
  • Select Delimited - Press Next - Select Space - Press Next
  • Press Finish
  • In D1 import =A1&RIGHT("0" & MONTH(DATEVALUE(B1&"1")),2)

Output:

enter image description here

Error 1004
  • 7,877
  • 3
  • 23
  • 46
1

Or just using :

=TEXT(MID(A1,6,3)&LEFT(A1,4),"yyymm")

enter image description here

bosco_yip
  • 3,762
  • 2
  • 5
  • 10
0

A1 = 2020 Aug ABC

B1

=LOOKUP(9^9,LEFT(A1,4)/1%+FIND(TEXT(ROW($1:$12)*28,"mmm"),A1)^0*ROW($1:$8))
Can.U
  • 461
  • 2
  • 8
0

Just another approach if your data is always same pattern.

=TEXT(DATEVALUE("01-"&MID(A1,6,3)&"-"&LEFT(A1,4)),"yyyymm")
Harun24hr
  • 30,391
  • 4
  • 21
  • 36