excel 問題一問

2009-03-03 7:07 pm
如果日期係2008/Feb/22
但今日日期係2009/mar/3
係EXCEL中點設定計相距幾多個月。
有冇呢d程式架。

回答 (4)

2009-03-03 7:54 pm
✔ 最佳答案
輸入日期前先設定日期格式,如
yyyy-mmm-d
輸入日期後按一般儲存格數值相減就可以,如
=d1-d2
如答案不是顯示正常日數,將儲存格格式轉回通用格式或數值便可以。得出日數再除以12就可以得出月數。
=(d1-d2)/12
==================================
如果要儲存格自動顯示今天的日期,公式是
=today()
2009-03-06 7:49 am
I think the solution from the another guy is more appropriate, which is

Set

A1 = 2008/Feb/22
B1 = today()

Number of months between these dates can be obtained by setting

C1 = month(b1) - month(a1)
2009-03-04 7:33 am
用Datedif 函數
假設A1是 開始日期, B1是結束日期
=DATEDIF(A1,B1,"m")
2009-03-04 6:37 am
Set

A1 = 2008/Feb/22
B1 = today()

Number of months between these dates can be obtained by setting

C1 = month(b1) - month(a1)


收錄日期: 2021-04-19 13:37:38
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20090303000051KK00351

檢視 Wayback Machine 備份