{"id":138006,"date":"2024-04-28T13:03:35","date_gmt":"2024-04-28T05:03:35","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/138006.html"},"modified":"2024-04-28T13:03:37","modified_gmt":"2024-04-28T05:03:37","slug":"excel%e8%a1%a8%e6%a0%bc%e6%80%8e%e4%b9%88%e6%a0%b9%e6%8d%ae%e8%ba%ab%e4%bb%bd%e8%af%81%e5%8f%b7%e7%a0%81%e8%af%86%e5%88%ab%e5%b9%b4%e9%be%84","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/138006.html","title":{"rendered":"excel\u8868\u683c\u600e\u4e48\u6839\u636e\u8eab\u4efd\u8bc1\u53f7\u7801\u8bc6\u522b\u5e74\u9f84"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24133918\/5b63922b-1926-4fc0-a364-232ae27405be.webp\" alt=\"excel\u8868\u683c\u600e\u4e48\u6839\u636e\u8eab\u4efd\u8bc1\u53f7\u7801\u8bc6\u522b\u5e74\u9f84\" \/><\/p>\n<p><p>\u5728Excel\u8868\u683c\u4e2d\uff0c\u6839\u636e\u8eab\u4efd\u8bc1\u53f7\u7801\u8bc6\u522b\u5e74\u9f84\u53ef\u4ee5\u901a\u8fc7\u516c\u5f0f\u8ba1\u7b97\u5b9e\u73b0\u3002<strong>\u8eab\u4efd\u8bc1\u53f7\u7684\u51fa\u751f\u5e74\u6708\u65e5\u4f4d\u4e8e\u53f7\u7801\u7684\u7b2c\u4e03\u4f4d\u81f3\u5341\u56db\u4f4d<\/strong>\u3001<strong>\u4f7f\u7528Excel\u5185\u7f6e\u7684\u65e5\u671f\u4e0e\u65f6\u95f4\u51fd\u6570<\/strong>\u3001<strong>\u7ed3\u5408\u6587\u672c\u5b57\u7b26\u4e32\u51fd\u6570<\/strong>\u4fbf\u53ef\u4ee5\u63d0\u53d6\u51fa\u8eab\u4efd\u8bc1\u4e0a\u7684\u51fa\u751f\u65e5\u671f\u5e76\u8ba1\u7b97\u51fa\u5e74\u9f84\u3002<\/p>\n<\/p>\n<p><p><strong>\u4e00\u3001\u63d0\u53d6\u8eab\u4efd\u8bc1\u53f7\u7801\u4e2d\u7684\u51fa\u751f\u65e5\u671f<\/strong><\/p>\n<p>\u9996\u5148\uff0c\u8981\u63d0\u53d6\u8eab\u4efd\u8bc1\u53f7\u7684\u51fa\u751f\u5e74\u6708\u65e5\uff0c\u53ef\u4ee5\u4f7f\u7528 <code>MID<\/code> \u51fd\u6570\u3002\u5047\u8bbe\u8eab\u4efd\u8bc1\u53f7\u7801\u4f4d\u4e8eA2\u5355\u5143\u683c\uff0c\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u516c\u5f0f\u6765\u83b7\u53d6\u51fa\u751f\u65e5\u671f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-excel\">=DATE(MID(A2, 7, 4), MID(A2, 11, 2), MID(A2, 13, 2))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8be5\u516c\u5f0f\u4f1a\u5148\u63d0\u53d6\u51fa\u5e74\u3001\u6708\u3001\u65e5\u7684\u4fe1\u606f\uff0c\u7136\u540e\u5229\u7528 <code>DATE<\/code> \u51fd\u6570\u8f6c\u6362\u4e3a\u65e5\u671f\u683c\u5f0f\u3002<\/p>\n<\/p>\n<p><p><strong>\u4e8c\u3001\u8ba1\u7b97\u5f53\u524d\u65e5\u671f\u4e0e\u51fa\u751f\u65e5\u671f\u7684\u5dee\u503c<\/strong><\/p>\n<p>\u63a5\u7740\uff0c\u6211\u4eec\u9700\u8981\u83b7\u5f97\u5f53\u524d\u65e5\u671f\u4e0e\u51fa\u751f\u65e5\u671f\u4e4b\u95f4\u7684\u5e74\u4efd\u5dee\u5f02\uff0c\u53ef\u4ee5\u7528 <code>TODAY<\/code> \u51fd\u6570\u5f97\u5230\u5f53\u524d\u65e5\u671f\uff0c\u7136\u540e\u901a\u8fc7 <code>DATEDIF<\/code> \u51fd\u6570\u8ba1\u7b97\u4e24\u4e2a\u65e5\u671f\u4e4b\u95f4\u7684\u5dee\u503c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-excel\">=DATEDIF(DATE(MID(A2, 7, 4), MID(A2, 11, 2), MID(A2, 13, 2)), TODAY(), &quot;Y&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e2a\u516c\u5f0f\u4f1a\u8ba1\u7b97\u51fa\u8eab\u4efd\u8bc1\u6301\u6709\u8005\u7684\u5b9e\u9645\u5e74\u9f84\u3002<\/p>\n<\/p>\n<p><p><strong>\u4e09\u3001\u8003\u8651\u95f0\u5e74\u548c\u751f\u65e5\u662f\u5426\u5df2\u8fc7<\/strong><\/p>\n<p>\u8ba1\u7b97\u5e74\u9f84\u65f6\u8fd8\u9700\u8003\u8651\u4eca\u5e74\u662f\u5426\u5df2\u8fc7\u751f\u65e5\u3002\u5982\u679c\u672a\u8fc7\u751f\u65e5\uff0c\u4e0a\u8ff0\u8ba1\u7b97\u7684\u5e74\u9f84\u8fd8\u9700\u51cf\u53bb\u4e00\u5c81\u3002\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u7684\u516c\u5f0f\u6765\u5224\u65ad\u5e76\u4fee\u6b63\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-excel\">=DATEDIF(DATE(MID(A2, 7, 4), MID(A2, 11, 2), MID(A2, 13, 2)), TODAY(), &quot;Y&quot;) - (TEXT(TODAY(),&quot;MMDD&quot;)&lt;TEXT(DATE(MID(A2, 7, 4), MID(A2, 11, 2), MID(A2, 13, 2)),&quot;MMDD&quot;))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u5f53\u524d\u65e5\u671f\u7684&quot;MMDD&quot;\u5c0f\u4e8e\u51fa\u751f\u65e5\u671f\u7684&quot;MMDD&quot;\uff0c\u8bf4\u660e\u751f\u65e5\u8fd8\u672a\u5230\uff0c\u5e74\u9f84\u9700\u8981\u51cf\u53bb1\u3002<\/p>\n<\/p>\n<p><p><strong>\u56db\u3001\u603b\u7ed3\u5b8c\u6574\u516c\u5f0f\u5e76\u586b\u5145<\/strong><\/p>\n<p>\u6700\u540e\u5c06\u4e0a\u8ff0\u6b65\u9aa4\u5408\u5e76\u6210\u4e00\u6761\u5b8c\u6574\u7684\u516c\u5f0f\uff0c\u586b\u5165\u8868\u683c\u9002\u5f53\u7684\u5355\u5143\u683c\u4e2d\uff0c\u7136\u540e\u5c06\u8be5\u5355\u5143\u683c\u5411\u4e0b\u62d6\u52a8\u4ee5\u5e94\u7528\u5230\u5176\u4ed6\u884c\u5bf9\u5e94\u7684\u8eab\u4efd\u8bc1\u53f7\u7801\u3002\u5b8c\u6574\u516c\u5f0f\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-excel\">=DATEDIF(DATE(MID(A2, 7, 4), MID(A2, 11, 2), MID(A2, 13, 2)), TODAY(), &quot;Y&quot;) - (TEXT(TODAY(),&quot;MMDD&quot;)&lt;TEXT(DATE(MID(A2, 7, 4), MID(A2, 11, 2), MID(A2, 13, 2)),&quot;MMDD&quot;))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6837\u5c31\u53ef\u4ee5\u5f97\u5230\u4e00\u5217\u53cd\u6620\u6bcf\u4e2a\u8eab\u4efd\u8bc1\u53f7\u7801\u5bf9\u5e94\u5e74\u9f84\u7684\u6570\u636e\u3002<\/p>\n<\/p>\n<p><p>\u8fd9\u4e2a\u65b9\u6cd5\u51c6\u786e\u6027\u8f83\u9ad8\uff0c\u4f46\u662f\u8981\u8003\u8651\u5230\u516c\u5386\u548c\u519c\u5386\u751f\u65e5\u7684\u95ee\u9898\uff0c\u5927\u591a\u6570\u8eab\u4efd\u8bc1\u4e0a\u91c7\u7528\u7684\u662f\u516c\u5386\u65e5\u671f\u3002\u6b64\u5916\uff0c\u5982\u679c\u8eab\u4efd\u8bc1\u53f7\u7801\u672c\u8eab\u5b58\u5728\u9519\u8bef\u6216\u8005\u662f\u4e00\u4e9b\u8001\u65e7\u8eab\u4efd\u8bc1\u53f7\u7801\uff0c\u5219\u53ef\u80fd\u5bfc\u81f4\u8ba1\u7b97\u9519\u8bef\u3002<\/p>\n<\/p>\n<p><p>\u5728Excel\u8868\u683c\u4e2d\u8bc6\u522b\u548c\u8ba1\u7b97\u5e74\u9f84\u5b9e\u9645\u4e0a\u662f\u4e00\u4e2a\u8f83\u4e3a\u5e38\u89c1\u7684\u64cd\u4f5c\u3002\u501f\u52a9Excel\u7684\u5f3a\u5927\u529f\u80fd\uff0c\u53ef\u4ee5\u5f88\u65b9\u4fbf\u5730\u5904\u7406\u548c\u5206\u6790\u6db5\u76d6\u5e7f\u6cdb\u4fe1\u606f\u7684\u6570\u636e\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u6df1\u5165\u8ba8\u8bbaExcel\u5728\u5904\u7406\u6b64\u7c7b\u4efb\u52a1\u65f6\u7684\u9ad8\u7ea7\u529f\u80fd\u548c\u6700\u4f73\u5b9e\u8df5\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>\u5982\u4f55\u5229\u7528Excel\u8868\u683c\u6309\u7167\u8eab\u4efd\u8bc1\u53f7\u7801\u8fdb\u884c\u5e74\u9f84\u8bc6\u522b\uff1f<\/strong><\/p>\n<ol>\n<li><strong>\u8eab\u4efd\u8bc1\u53f7\u7801\u4e2d\u7684\u51e0\u4f4d\u6570\u5b57\u4ee3\u8868\u4e86\u51fa\u751f\u5e74\u6708\u65e5\uff0c\u6211\u4eec\u53ef\u4ee5\u5229\u7528Excel\u7684\u51fd\u6570\u6765\u63d0\u53d6\u51fa\u751f\u65e5\u671f\u3002<\/strong><\/li>\n<\/ol>\n<p>\u5728Excel\u4e2d\uff0c\u53ef\u4f7f\u7528\u5982\u4e0b\u516c\u5f0f\u63d0\u53d6\u8eab\u4efd\u8bc1\u53f7\u7801\u4e2d\u7684\u51fa\u751f\u65e5\u671f\uff1a<\/p>\n<pre><code>=DATEVALUE(MID(A1,7,2)&amp;&quot;\/&quot;&amp;MID(A1,9,2)&amp;&quot;\/&quot;&amp;MID(A1,11,2))\n<\/code><\/pre>\n<p>\u5176\u4e2dA1\u662f\u5b58\u653e\u8eab\u4efd\u8bc1\u53f7\u7801\u7684\u5355\u5143\u683c\uff0c\u6839\u636e\u9700\u8981\u4fee\u6539\u5355\u5143\u683c\u5f15\u7528\u3002\u7ed3\u679c\u4f1a\u4ee5\u65e5\u671f\u7684\u5f62\u5f0f\u663e\u793a\u3002<\/p>\n<ol start=\"2\">\n<li><strong>\u8ba1\u7b97\u5e74\u9f84<\/strong><\/li>\n<\/ol>\n<p>\u6709\u4e86\u51fa\u751f\u65e5\u671f\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4e0b\u5217\u516c\u5f0f\u6765\u8ba1\u7b97\u5e74\u9f84\uff1a<\/p>\n<pre><code>=DATEDIF(B1,TODAY(),&quot;y&quot;)\n<\/code><\/pre>\n<p>\u5176\u4e2dB1\u662f\u5b58\u653e\u63d0\u53d6\u51fa\u7684\u51fa\u751f\u65e5\u671f\u7684\u5355\u5143\u683c\u3002TODAY()\u51fd\u6570\u8868\u793a\u5f53\u524d\u65e5\u671f\uff0cDATEDIF\u51fd\u6570\u8ba1\u7b97\u4e24\u4e2a\u65e5\u671f\u4e4b\u95f4\u7684\u5dee\u503c\uff0c&quot;y&quot;\u8868\u793a\u8fd4\u56de\u7684\u662f\u5e74\u4efd\u5dee\u503c\u3002<\/p>\n<ol start=\"3\">\n<li><strong>\u5c06\u5e74\u9f84\u663e\u793a\u4e3a\u6574\u6570<\/strong><\/li>\n<\/ol>\n<p>Excel\u4e2d\u7528\u6765\u663e\u793a\u5e74\u9f84\u7684\u5355\u5143\u683c\u901a\u5e38\u4f1a\u663e\u793a\u5c0f\u6570\u6216\u65e5\u671f\u683c\u5f0f\uff0c\u4e3a\u4e86\u4f7f\u5f97\u5e74\u9f84\u4ee5\u6574\u6570\u5f62\u5f0f\u663e\u793a\uff0c\u6211\u4eec\u9700\u8981\u4fee\u6539\u5355\u5143\u683c\u683c\u5f0f\u3002\u5177\u4f53\u64cd\u4f5c\u5982\u4e0b\uff1a   <\/p>\n<ul>\n<li>\u9009\u4e2d\u5b58\u653e\u5e74\u9f84\u7684\u5355\u5143\u683c\uff1b<\/li>\n<li>\u53f3\u952e\u5355\u51fb\uff0c\u9009\u62e9\u201c\u683c\u5f0f\u5355\u5143\u683c\u201d\uff1b<\/li>\n<li>\u5728\u201c\u6570\u503c\u201d\u9009\u9879\u5361\u4e0b\u9009\u62e9\u201c\u5e38\u89c4\u201d\uff1b<\/li>\n<li>\u70b9\u51fb\u201c\u786e\u5b9a\u201d\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u6837\uff0c\u4f60\u5c31\u53ef\u4ee5\u5728Excel\u8868\u683c\u4e2d\u6839\u636e\u8eab\u4efd\u8bc1\u53f7\u7801\u8bc6\u522b\u51fa\u5e74\u9f84\u4e86\u3002<\/p>\n<p><strong>\u5982\u4f55\u7528Excel\u6839\u636e\u8eab\u4efd\u8bc1\u53f7\u7801\u548c\u5f53\u524d\u65e5\u671f\u81ea\u52a8\u8ba1\u7b97\u5e74\u9f84\uff1f<\/strong><\/p>\n<ol>\n<li>\u5728\u8868\u683c\u4e2d\u65b0\u5efa\u4e24\u4e2a\u5217\uff0c\u5206\u522b\u7528\u4e8e\u8f93\u5165\u8eab\u4efd\u8bc1\u53f7\u7801\u548c\u5f53\u524d\u65e5\u671f\u3002<\/li>\n<li>\u5728\u7b2c\u4e09\u5217\u4e2d\u4f7f\u7528\u516c\u5f0f\u8ba1\u7b97\u5e74\u9f84\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/li>\n<\/ol>\n<pre><code>=INT((TODAY()-DATE(YEAR(B1),MONTH(B1),DAY(B1)))\/365)\n<\/code><\/pre>\n<p>\u5176\u4e2dB1\u662f\u5b58\u653e\u8eab\u4efd\u8bc1\u53f7\u7801\u7684\u5355\u5143\u683c\uff0c\u4e0e\u524d\u6587\u7c7b\u4f3c\uff0c\u8ba1\u7b97\u51fa\u751f\u65e5\u671f\u3002<br \/>\n3. \u5c06\u516c\u5f0f\u62d6\u81f3\u4e0b\u65b9\u7684\u5355\u5143\u683c\u4e2d\u81ea\u52a8\u586b\u5145\uff0c\u5373\u53ef\u6839\u636e\u6bcf\u4e2a\u4eba\u7684\u8eab\u4efd\u8bc1\u53f7\u7801\u548c\u5f53\u524d\u65e5\u671f\u81ea\u52a8\u8ba1\u7b97\u51fa\u5e74\u9f84\u3002<\/p>\n<p><strong>\u5982\u4f55\u7528Excel\u8868\u683c\u5bf9\u8eab\u4efd\u8bc1\u53f7\u7801\u8fdb\u884c\u6279\u91cf\u5e74\u9f84\u8bc6\u522b\uff1f<\/strong><\/p>\n<ol>\n<li>\u5c06\u9700\u8981\u8bc6\u522b\u5e74\u9f84\u7684\u8eab\u4efd\u8bc1\u53f7\u7801\u5b58\u50a8\u5728Excel\u8868\u683c\u4e2d\u7684\u4e00\u5217\u4e2d\u3002<\/li>\n<li>\u5728\u65c1\u8fb9\u7684\u7a7a\u767d\u5217\u4e2d\uff0c\u4f7f\u7528\u524d\u6587\u63d0\u5230\u7684\u516c\u5f0f\u63d0\u53d6\u51fa\u751f\u65e5\u671f\uff0c\u5e76\u5c06\u516c\u5f0f\u62d6\u81f3\u9700\u8981\u8bc6\u522b\u7684\u8eab\u4efd\u8bc1\u53f7\u7801\u7684\u6240\u6709\u5355\u5143\u683c\u4e2d\u3002<\/li>\n<li>\u5c06\u63d0\u53d6\u51fa\u7684\u51fa\u751f\u65e5\u671f\u5217\u53f3\u952e\u590d\u5236\uff0c\u7136\u540e\u53f3\u952e\u7c98\u8d34\u4e3a\u6570\u503c\u3002\u8fd9\u6837\uff0c\u53ef\u4ee5\u4f7f\u5f97\u51fa\u751f\u65e5\u671f\u7684\u8ba1\u7b97\u7ed3\u679c\u4f5c\u4e3a\u6570\u503c\u8fdb\u884c\u540e\u7eed\u64cd\u4f5c\u3002<\/li>\n<li>\u4f7f\u7528\u4e0a\u6587\u63d0\u5230\u7684\u5e74\u9f84\u8ba1\u7b97\u516c\u5f0f\uff0c\u5728\u53f3\u8fb9\u7684\u7a7a\u767d\u5217\u4e2d\u8ba1\u7b97\u6bcf\u4e2a\u4eba\u7684\u5e74\u9f84\uff0c\u5e76\u5c06\u516c\u5f0f\u62d6\u81f3\u9700\u8981\u8bc6\u522b\u7684\u8eab\u4efd\u8bc1\u53f7\u7801\u7684\u6240\u6709\u5355\u5143\u683c\u4e2d\u3002<\/li>\n<li>\u6700\u540e\uff0c\u5c06\u5e74\u9f84\u5217\u8bbe\u7f6e\u4e3a\u6574\u6570\u683c\u5f0f\uff0c\u4ee5\u4fbf\u4ee5\u6574\u6570\u5f62\u5f0f\u663e\u793a\u5e74\u9f84\u3002<\/li>\n<\/ol>\n<p>\u8fd9\u6837\uff0c\u4f60\u5c31\u53ef\u4ee5\u6279\u91cf\u4f7f\u7528Excel\u8868\u683c\u5bf9\u8eab\u4efd\u8bc1\u53f7\u7801\u8fdb\u884c\u5e74\u9f84\u8bc6\u522b\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Excel\u8868\u683c\u4e2d\uff0c\u6839\u636e\u8eab\u4efd\u8bc1\u53f7\u7801\u8bc6\u522b\u5e74\u9f84\u53ef\u4ee5\u901a\u8fc7\u516c\u5f0f\u8ba1\u7b97\u5b9e\u73b0\u3002\u8eab\u4efd\u8bc1\u53f7\u7684\u51fa\u751f\u5e74\u6708\u65e5\u4f4d\u4e8e\u53f7\u7801\u7684\u7b2c\u4e03\u4f4d\u81f3\u5341\u56db\u4f4d\u3001 [&hellip;]","protected":false},"author":3,"featured_media":138009,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/138006"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=138006"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/138006\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/138009"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=138006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=138006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=138006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}