ä¸ãè¿å¯ä»¥ç¨
DATEDIFå½æ°æ¥å®æã
äºãDATEDIFå½æ°çå®ä¹
DATEDIFå½æ°æ¯Exceléèå½æ°ï¼å¨å¸®å©åæå
¥å
¬å¼éé¢æ²¡æã è¿å两个æ¥æä¹é´çå¹´\æ\æ¥é´éæ°ã常使ç¨DATEDIFå½æ°è®¡ç®ä¸¤æ¥æä¹å·®ã
è¯æ³
DATEDIF(start_date,end_date,unit)
Start_date 为ä¸ä¸ªæ¥æï¼å®ä»£è¡¨æ¶é´æ®µå
ç第ä¸ä¸ªæ¥ææèµ·å§æ¥æã
End_date 为ä¸ä¸ªæ¥æï¼å®ä»£è¡¨æ¶é´æ®µå
çæåä¸ä¸ªæ¥ææç»ææ¥æã
Unit 为æéä¿¡æ¯çè¿åç±»åã
Unit è¿å
注ï¼ç»ææ¥æå¿
须大äºèµ·å§æ¥æ
ä¸é¢ä¸¾ä¸ªå°ä¾åï¼å¨æ¥å¸¸å·¥ä½ä¸é常å®ç¨ã
åå¦A1åå
æ ¼åçä¹æ¯ä¸ä¸ªæ¥æï¼é£ä¹ä¸é¢çä¸ä¸ªå
¬å¼å¯ä»¥è®¡ç®åºA1åå
æ ¼çæ¥æåä»å¤©ç
æ¶é´å·®ï¼åå«æ¯å¹´æ°å·®ï¼ææ°å·®ï¼å¤©æ°å·®ã
注æä¸é¢å
¬å¼ä¸çå¼å·åéå·æ¬å·é½æ¯å¨è±æç¶æä¸è¾å
¥çã
=DATEDIF(A1,TODAY(),"Y") 计ç®å¹´æ°å·®
=DATEDIF(A1,TODAY(),"M") 计ç®ææ°å·®
=DATEDIF(A1,TODAY(),"D") 计ç®å¤©æ°å·®
"Y" æ¶é´æ®µä¸çæ´å¹´æ°ã
"M" æ¶é´æ®µä¸çæ´ææ°ã
"D" æ¶é´æ®µä¸ç天æ°ã
"MD" start_date ä¸ end_date æ¥æä¸å¤©æ°çå·®ã忽ç¥æ¥æä¸çæåå¹´ã
"YM" start_date ä¸end_date æ¥æä¸ææ°çå·®ã忽ç¥æ¥æä¸çå¹´ã
"YD" start_date ä¸ end_date æ¥æä¸å¤©æ°çå·®ã忽ç¥æ¥æä¸çå¹´ã
ä¸ãå®ä¾è¯´æ
å®ä¾1ï¼
é¢ç®ï¼ 计ç®åºçæ¥æ为1973-4-1人çå¹´é¾
å
¬å¼ï¼ =DATEDIF("1973-4-1",TODAY(),"Y")
ç»æï¼ 33
ç®è¦è¯´æ å½åä½ä»£ç 为"Y"æ¶,计ç®ç»ææ¯ä¸¤ä¸ªæ¥æé´éçå¹´æ°.
å®ä¾2ï¼
é¢ç®ï¼ 计ç®æ¥æ为1973-4-1åå½åæ¥æçé´éæ份æ°.
å
¬å¼ï¼ =DATEDIF("1973-4-1",TODAY(),"M")
ç»æï¼ 403
ç®è¦è¯´æ å½åä½ä»£ç 为"M"æ¶,计ç®ç»ææ¯ä¸¤ä¸ªæ¥æé´éçæ份æ°.
å®ä¾3ï¼
é¢ç®ï¼ 计ç®æ¥æ为1973-4-1åå½åæ¥æçé´é天æ°.
å
¬å¼ï¼ =DATEDIF("1973-4-1",TODAY(),"D")
ç»æï¼ 12273ç®è¦è¯´æ å½åä½ä»£ç 为"D"æ¶,计ç®ç»ææ¯ä¸¤ä¸ªæ¥æé´éç天æ°.
å®ä¾4ï¼
é¢ç®ï¼ 计ç®æ¥æ为1973-4-1åå½åæ¥æçä¸è®¡å¹´æ°çé´é天æ°.
å
¬å¼ï¼ =DATEDIF("1973-4-1",TODAY(),"YD")
ç»æï¼ 220
ç®è¦è¯´æ å½åä½ä»£ç 为"YD"æ¶,计ç®ç»ææ¯ä¸¤ä¸ªæ¥æé´éç天æ°.忽ç¥å¹´æ°å·®
å®ä¾5ï¼
é¢ç®ï¼ 计ç®æ¥æ为1973-4-1åå½åæ¥æçä¸è®¡æ份å年份çé´é天æ°.
å
¬å¼ï¼ =DATEDIF("1973-4-1",TODAY(),"MD")
ç»æï¼ 6
ç®è¦è¯´æ å½åä½ä»£ç 为"MD"æ¶,计ç®ç»ææ¯ä¸¤ä¸ªæ¥æé´éç天æ°.忽ç¥å¹´æ°åæ份ä¹å·®
å®ä¾6ï¼
é¢ç®ï¼ 计ç®æ¥æ为1973-4-1åå½åæ¥æçä¸è®¡å¹´ä»½çé´éæ份æ°.
å
¬å¼ï¼ =DATEDIF("1973-4-1",TODAY(),"YM")
ç»æï¼ 7
ç®è¦è¯´æ å½åä½ä»£ç 为"YM"æ¶,计ç®ç»ææ¯ä¸¤ä¸ªæ¥æé´éçæ份æ°.ä¸è®¡ç¸å·®å¹´æ°æ³¨æï¼TODAY()å½æ°è·åçæ¯ç³»ç»å½åæ¥æï¼ææå举çå®ä¾ä¸º2006-11-7æ¥ç计ç®ç»æï¼å¹¶ä¸ä¸å®åä½ å¾å°çç»æç¸ç¬¦ã
åãå设å¼å§æ¥æåå¨A1åå
æ ¼ï¼ç»ææ¥æåå¨B1åå
æ ¼ï¼è¦å¨C1åå
æ ¼å¾åºä¸¤ä¸ªæ¥æç¸å·®çå¹´æ°åææ°ï¼åå
¬å¼å¯ä»¥åæå¦ä¸
=DATEDIF(A1,B1,"y")&"å¹´"&DATEDIF(A1,B1,"ym")&"个æ"