介紹如何使用 Excel 的 SUBSTITUTE
、LEFT
、MID
、RIGHT
函數自動將西元日期轉換為民國日期。
西元日期轉民國日期(標準格式)
假設我們的西元日期原始資料都是以 Excel 的日期格式儲存的,實際資料如下。

如果要將 Excel 標準格式的西元日期(Excel 日期類型的資料)轉換為民國日期,可以透過撰寫公式或是調整儲存格格式兩種方式。
以公式轉換
若要將這些西元日期轉換為民國日期,第一種方式是以 YEAR
、MONTH
與 DAY
將年、月、日取出後,將年份減去 1911 後,組合成民國的日期。
=(YEAR(A2)-1911)&"/"&MONTH(A2)&"/"&DAY(A2)

以儲存格格式轉換
除了自己撰寫公式轉換西元與民國日期之外,對於 Excel 標準的日期資料,也可以透過調整儲存格格式的方式,自動讓 Excel 處理西元與民國的日期換算。
Step 1
將原始的日期資料複製到新的儲存格中。
=A2

Step 2
調整新日期資料的儲存格格式。

在「行事曆類型」選項中,選擇「中華民國曆」,然後選擇想要的日期格式。

Step 4
這樣 Excel 就會自動將日期資料以民國的日期來顯示了。

西元日期轉民國日期(非標準格式)
假設原始的西元日期資料不是 Excel 標準的日期格式,而年、月、日的位數也不是固定的,這種情況就會比較複雜。

遇到這種情況時,可以先將問題拆解成兩部分,首先將原始西元日期中的年、月、日分別取出,再將其轉換為民國日期。
Step 1
先在表格中增加轉換用的資料欄位,然後將原始日期中的分隔符號(在這個例子中就是句點)取代為兩個句點,目的在於讓我們在取出資料時多一些緩衝空間。
=SUBSTITUTE(A2,".","..")

Step 2
使用 LEFT
函數將年份取出,因為西元的年份固定是四位數,所以只要單純擷取日期的前四個字元即可。
=LEFT(B2,4)

Step 3
使用 MID
抓取月份資料,由於月份的資料寬度可能是一位數或兩位數,所以取出後的資料有可能會包含多餘的句點,要再以 SUBSTITUTE
函數將多餘的句點去除。
=SUBSTITUTE(MID(B2,7,2),".","")

Step 4
擷取日的部分也很類似,將日的資料取出後,以 SUBSTITUTE
函數將多餘的句點去除。
=SUBSTITUTE(RIGHT(B2,2),".","")

Step 5
將年減去 1911
之後,結合月、日的資料,即可組合成民國的日期。
=(C2-1911)&"年"&D2&"月"&E2&"日"

This is very interesting, You are a very professional blogger.
I’ve joined your feed and look ahead to searching for more of your great post.
Additionally, I’ve shared your website in my social
networks
Have you ever thought about publishing an ebook
or guest authoring on other blogs? I have a blog based on the same information you discuss and would love to have you share some stories/information. I know my viewers would
appreciate your work. If you’re even remotely interested, feel free to send me an e mail.
Undeniably believe that which you said. Your favorite justification seemed to be on the
net the easiest thing to be aware of. I say to you, I certainly get annoyed while people think about
worries that they plainly do not know about.
You managed to hit the nail upon the top and defined out the whole thing without
having side-effects , people can take a signal.
Will likely be back to get more. Thanks
This is really interesting, You’re a very skilled blogger. I have joined your
rss feed and look forward to seeking more of your fantastic post.
Also, I have shared your website in my social networks!
It’s great that you are getting thoughts from this post as well as from our argument made at this place.