![](/img/trans.png)
[英]How can I calculate the difference between two date time values in the format yyyymm using excel formula?
[英]How to convert text “yyyy mmm ABC” to “yyyymm” date format using Excel formula?
假設我的單元格值等於
"2020 Aug ABC"
在 Excel 中。
我想使用 excel 公式將其轉換為202008
日期格式,因為我想使用 output 值,即 202008 來執行一些操作。
如果您的數據在A1
中:
=LEFT(A1,4) & TEXT((DATEVALUE(MID(A1,6,3) & " 1")),"mm")
如果您的數據始終是相同的模式,這只是另一種方法。
=TEXT(DATEVALUE("01-"&MID(A1,6,3)&"-"&LEFT(A1,4)),"yyyymm")
A1 = 2020 年 8 月 ABC
B1
=LOOKUP(9^9,LEFT(A1,4)/1%+FIND(TEXT(ROW($1:$12)*28,"mmm"),A1)^0*ROW($1:$8))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.