{"id":137253,"date":"2024-04-28T12:48:58","date_gmt":"2024-04-28T04:48:58","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/137253.html"},"modified":"2024-04-28T12:49:05","modified_gmt":"2024-04-28T04:49:05","slug":"excel%e8%a1%a8%e6%a0%bc%e5%a6%82%e4%bd%95%e6%8f%90%e5%8f%96%e5%b9%b4%e6%9c%88%e6%97%a5","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/137253.html","title":{"rendered":"excel\u8868\u683c\u5982\u4f55\u63d0\u53d6\u5e74\u6708\u65e5"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24133258\/52e20c4e-ce2d-4d5a-8826-a4225c80b6d9.webp\" alt=\"excel\u8868\u683c\u5982\u4f55\u63d0\u53d6\u5e74\u6708\u65e5\" \/><\/p>\n<p><p>Excel\u8868\u683c\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u6cd5\u63d0\u53d6\u51fa\u65e5\u671f\u7684\u5e74\u3001\u6708\u3001\u65e5\u90e8\u5206\u3002\u6838\u5fc3\u65b9\u6cd5\u6709\u4f7f\u7528<strong>\u65e5\u671f\u51fd\u6570<\/strong>\u3001<strong>\u6587\u672c\u51fd\u6570<\/strong>\u4ee5\u53ca<strong>\u683c\u5f0f\u5316\u529f\u80fd<\/strong>\u3002\u4e3e\u4f8b\u6765\u8bf4\uff0c\u5047\u8bbe\u6709\u4e00\u4e2a\u65e5\u671f2023\u5e743\u670815\u65e5\u5728A1\u5355\u5143\u683c\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528YEAR(A1)\u6765\u63d0\u53d6\u5e74\u4efd\uff0cMONTH(A1)\u6765\u63d0\u53d6\u6708\u4efd\uff0cDAY(A1)\u6765\u63d0\u53d6\u8be5\u65e5\u5bf9\u5e94\u7684\u5929\u6570\u3002\u5bf9\u4e8e\u6587\u672c\u5f62\u5f0f\u7684\u65e5\u671f\uff0c\u901a\u5e38\u9700\u8981\u5148\u8f6c\u6362\u4e3aExcel\u53ef\u8bc6\u522b\u7684\u65e5\u671f\u683c\u5f0f\uff0c\u7136\u540e\u518d\u63d0\u53d6\u5bf9\u5e94\u7684\u5e74\u3001\u6708\u3001\u65e5\u3002<\/p>\n<\/p>\n<p><p>\u8981\u8be6\u7ec6\u4e86\u89e3\u8fd9\u4e2a\u8fc7\u7a0b\uff0c\u6211\u4eec\u4f1a\u5206\u522b\u901a\u8fc7\u201c\u4f7f\u7528\u51fd\u6570\u201d\u3001\u201c\u6587\u672c\u5230\u5217\u201d\u7b49\u65b9\u6cd5\u5b8c\u6574\u5730\u63a2\u8ba8\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528\u65e5\u671f\u51fd\u6570<\/h3>\n<\/p>\n<p><p>Excel\u4e2d\u63d0\u4f9b\u4e86\u5185\u5efa\u7684\u65e5\u671f\u51fd\u6570\uff0c\u53ef\u4ee5\u76f4\u63a5\u63d0\u53d6\u51fa\u5e74\u3001\u6708\u548c\u65e5\u7684\u503c\u3002<\/p>\n<\/p>\n<p><h4>\u5e74\u4efd\u63d0\u53d6\uff1a<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528YEAR\u51fd\u6570\uff0c\u8f93\u5165<code>=YEAR(A1)<\/code>\uff0c\u5373\u53ef\u8fd4\u56deA1\u5355\u5143\u683c\u4e2d\u65e5\u671f\u7684\u5e74\u4efd\u90e8\u5206\u3002<\/p>\n<\/p>\n<p><h4>\u6708\u4efd\u63d0\u53d6\uff1a<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528MONTH\u51fd\u6570\uff0c\u8f93\u5165<code>=MONTH(A1)<\/code>\uff0c\u53ef\u4ee5\u5f97\u5230\u6708\u4efd\u4fe1\u606f\u3002<\/p>\n<\/p>\n<p><h4>\u65e5\u63d0\u53d6\uff1a<\/h4>\n<\/p>\n<p><p>\u901a\u8fc7DAY\u51fd\u6570\uff0c\u8f93\u5165<code>=DAY(A1)<\/code>\u6765\u83b7\u53d6\u65e5\u7684\u90e8\u5206\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528\u6587\u672c\u51fd\u6570<\/h3>\n<\/p>\n<p><p>\u5f53\u65e5\u671f\u4ee5\u6587\u672c\u683c\u5f0f\u5448\u73b0\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528LEFT\u3001MID\u548cRIGHT\u51fd\u6570\u7ed3\u5408FIND\u6216SEARCH\u51fd\u6570\u6765\u63d0\u53d6\u65e5\u671f\u7684\u5404\u4e2a\u90e8\u5206\u3002<\/p>\n<\/p>\n<p><h4>\u5e74\u4efd\u7684\u63d0\u53d6\uff1a<\/h4>\n<\/p>\n<p><p>\u53ef\u4ee5\u4f7f\u7528LEFT\u51fd\u6570\u914d\u5408FIND\u51fd\u6570\uff0c\u5047\u8bbe\u65e5\u671f\u662f\u4ee5&quot;YYYY-MM-DD&quot;\u7684\u683c\u5f0f\u4f5c\u4e3a\u5b57\u7b26\u4e32\u5b58\u5728\uff0c\u53ef\u4ee5\u4f7f\u7528<code>=LEFT(A1, FIND(&quot;-&quot;, A1)-1)<\/code> \u6765\u627e\u5230\u5e74\u4efd\u3002<\/p>\n<\/p>\n<p><h4>\u6708\u4efd\u7684\u63d0\u53d6\uff1a<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528MID\u51fd\u6570\u7ed3\u5408FIND\u51fd\u6570\uff0c\u516c\u5f0f\u53ef\u80fd\u770b\u8d77\u6765\u50cf\u8fd9\u6837<code>=MID(A1, FIND(&quot;-&quot;, A1)+1, FIND(&quot;-&quot;, A1, FIND(&quot;-&quot;, A1)+1)-FIND(&quot;-&quot;, A1)-1)<\/code>\u3002<\/p>\n<\/p>\n<p><h4>\u65e5\u7684\u63d0\u53d6\uff1a<\/h4>\n<\/p>\n<p><p>RIGHT\u51fd\u6570\u53ef\u4ee5\u4ece\u6587\u672c\u7684\u53f3\u4fa7\u5f00\u59cb\u63d0\u53d6\u5b57\u7b26\uff0c\u4f8b\u5982<code>=RIGHT(A1, LEN(A1) - FIND(&quot;-&quot;, A1, FIND(&quot;-&quot;, A1)+1))<\/code>\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u683c\u5f0f\u5316\u529f\u80fd<\/h3>\n<\/p>\n<p><p>\u501f\u52a9Excel\u7684\u201c\u5355\u5143\u683c\u683c\u5f0f\u201d\u529f\u80fd\uff0c\u53ef\u4ee5\u5c06\u65e5\u671f\u7684\u663e\u793a\u683c\u5f0f\u66f4\u6539\u4e3a\u53ea\u663e\u793a\u5e74\u3001\u6708\u6216\u65e5\u3002<\/p>\n<\/p>\n<p><h4>\u5e74\u4efd\u7684\u663e\u793a\uff1a<\/h4>\n<\/p>\n<p><p>\u9009\u62e9\u542b\u6709\u65e5\u671f\u7684\u5355\u5143\u683c\uff0c\u7136\u540e\u53f3\u952e\u9009\u62e9\u201c\u683c\u5f0f\u5355\u5143\u683c\u201d-&gt;\u201c\u6570\u5b57\u201d-&gt;\u201c\u81ea\u5b9a\u4e49\u201d\uff0c\u5728\u7c7b\u578b\u680f\u8f93\u5165\u201cYYYY\u201d\uff0c\u5373\u53ef\u663e\u793a\u4e3a\u5e74\u4efd\u3002<\/p>\n<\/p>\n<p><h4>\u6708\u4efd\u7684\u663e\u793a\uff1a<\/h4>\n<\/p>\n<p><p>\u540c\u6837\u7684\u6b65\u9aa4\uff0c\u6539\u7c7b\u578b\u4e3a\u201cMM\u201d\uff0c\u5373\u53ef\u663e\u793a\u4e3a\u6708\u4efd\u3002<\/p>\n<\/p>\n<p><h4>\u65e5\u7684\u663e\u793a\uff1a<\/h4>\n<\/p>\n<p><p>\u64cd\u4f5c\u65b9\u6cd5\u540c\u4e0a\uff0c\u7c7b\u578b\u6539\u4e3a&quot;DD&quot;\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u5176\u4ed6\u63d0\u53d6\u6280\u5de7<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u4e0a\u8ff0\u65b9\u6cd5\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528\u6570\u636e\u900f\u89c6\u8868\u6216VBA\u5b8f\u7b49\u9ad8\u7ea7\u529f\u80fd\u6765\u5904\u7406\u65e5\u671f\u6570\u636e\u3002<\/p>\n<\/p>\n<p><h4>\u6570\u636e\u900f\u89c6\u8868\u63d0\u53d6\uff1a<\/h4>\n<\/p>\n<p><p>\u5c06\u65e5\u671f\u5b57\u6bb5\u62d6\u5165\u6570\u636e\u900f\u89c6\u8868\u7684\u884c\u6216\u5217\u5b57\u6bb5\u533a\u57df\uff0c\u7136\u540e\u6839\u636e\u9700\u8981\u9009\u62e9\u201c\u5206\u7ec4\u201d\u529f\u80fd\uff0c\u5c31\u53ef\u4ee5\u6309\u7167\u5e74\u3001\u6708\u6216\u65e5\u6765\u67e5\u770b\u6570\u636e\u3002<\/p>\n<\/p>\n<p><h4>VBA\u5b8f\u63d0\u53d6\uff1a<\/h4>\n<\/p>\n<p><p>\u521b\u5efa\u4e00\u4e2a\u5b8f\u51fd\u6570\uff0c\u7528\u4e8e\u5904\u7406\u4e0d\u89c4\u5219\u683c\u5f0f\u7684\u65e5\u671f\u5b57\u7b26\u4e32\uff0c\u8fd9\u79cd\u65b9\u6cd5\u5bf9\u4e8e\u6279\u91cf\u5904\u7406\u5177\u6709\u4e00\u5b9a\u4f18\u52bf\u3002<\/p>\n<\/p>\n<p><p>\u968f\u7740Excel\u7684\u4e0d\u65ad\u66f4\u65b0\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u66f4\u591a\u7528\u6237\u53cb\u597d\u7684\u65e5\u671f\u5904\u7406\u5de5\u5177\uff0c\u4f46\u57fa\u672c\u7684\u51fd\u6570\u65b9\u6cd5\u5f88\u53ef\u80fd\u4ecd\u5c06\u662f\u63d0\u53d6\u65e5\u671f\u7ec4\u4ef6\u7684\u4e3b\u6d41\u624b\u6bb5\u3002\u5728\u5b66\u4e60\u4f7f\u7528\u8fd9\u4e9b\u5de5\u5177\u65f6\uff0c\u8bb0\u5f97\u52a0\u5f3a\u5b9e\u8df5\uff0c\u8fd9\u6709\u52a9\u4e8e\u66f4\u9ad8\u6548\u5730\u89e3\u51b3\u5b9e\u9645\u5de5\u4f5c\u4e2d\u7684\u95ee\u9898\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>1. Excel\u8868\u683c\u4e2d\u5982\u4f55\u6839\u636e\u65e5\u671f\u63d0\u53d6\u5e74\u4efd\uff1f<\/strong><\/p>\n<p>\u5728Excel\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u51fd\u6570\u6765\u4ece\u65e5\u671f\u4e2d\u63d0\u53d6\u5e74\u4efd\u3002\u5177\u4f53\u64cd\u4f5c\u662f\u4f7f\u7528YEAR\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u4f1a\u8fd4\u56de\u65e5\u671f\u7684\u5e74\u4efd\u3002\u4f8b\u5982\uff0c\u5047\u8bbe\u65e5\u671f\u4f4d\u4e8eA1\u5355\u5143\u683c\u4e2d\uff0c\u60a8\u53ef\u4ee5\u5728B1\u5355\u5143\u683c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u51fd\u6570\u6765\u63d0\u53d6\u5e74\u4efd\uff1a<\/p>\n<p><code>=YEAR(A1)<\/code><\/p>\n<p>\u8fd0\u884c\u6b64\u51fd\u6570\u540e\uff0cB1\u5355\u5143\u683c\u5c06\u663e\u793aA1\u5355\u5143\u683c\u4e2d\u65e5\u671f\u7684\u5e74\u4efd\u3002<\/p>\n<p><strong>2. Excel\u8868\u683c\u4e2d\u5982\u4f55\u6839\u636e\u65e5\u671f\u63d0\u53d6\u6708\u4efd\uff1f<\/strong><\/p>\n<p>\u5728Excel\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u51fd\u6570\u6765\u4ece\u65e5\u671f\u4e2d\u63d0\u53d6\u6708\u4efd\u3002\u5177\u4f53\u64cd\u4f5c\u662f\u4f7f\u7528MONTH\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u4f1a\u8fd4\u56de\u65e5\u671f\u7684\u6708\u4efd\u3002\u4f8b\u5982\uff0c\u5047\u8bbe\u65e5\u671f\u4f4d\u4e8eA1\u5355\u5143\u683c\u4e2d\uff0c\u60a8\u53ef\u4ee5\u5728B1\u5355\u5143\u683c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u51fd\u6570\u6765\u63d0\u53d6\u6708\u4efd\uff1a<\/p>\n<p><code>=MONTH(A1)<\/code><\/p>\n<p>\u8fd0\u884c\u6b64\u51fd\u6570\u540e\uff0cB1\u5355\u5143\u683c\u5c06\u663e\u793aA1\u5355\u5143\u683c\u4e2d\u65e5\u671f\u7684\u6708\u4efd\u3002<\/p>\n<p><strong>3. Excel\u8868\u683c\u4e2d\u5982\u4f55\u6839\u636e\u65e5\u671f\u63d0\u53d6\u65e5\u4efd\uff1f<\/strong><\/p>\n<p>\u5728Excel\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u51fd\u6570\u6765\u4ece\u65e5\u671f\u4e2d\u63d0\u53d6\u65e5\u4efd\u3002\u5177\u4f53\u64cd\u4f5c\u662f\u4f7f\u7528DAY\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u4f1a\u8fd4\u56de\u65e5\u671f\u7684\u65e5\u4efd\u3002\u4f8b\u5982\uff0c\u5047\u8bbe\u65e5\u671f\u4f4d\u4e8eA1\u5355\u5143\u683c\u4e2d\uff0c\u60a8\u53ef\u4ee5\u5728B1\u5355\u5143\u683c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u51fd\u6570\u6765\u63d0\u53d6\u65e5\u4efd\uff1a<\/p>\n<p><code>=DAY(A1)<\/code><\/p>\n<p>\u8fd0\u884c\u6b64\u51fd\u6570\u540e\uff0cB1\u5355\u5143\u683c\u5c06\u663e\u793aA1\u5355\u5143\u683c\u4e2d\u65e5\u671f\u7684\u65e5\u4efd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Excel\u8868\u683c\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u6cd5\u63d0\u53d6\u51fa\u65e5\u671f\u7684\u5e74\u3001\u6708\u3001\u65e5\u90e8\u5206\u3002\u6838\u5fc3\u65b9\u6cd5\u6709\u4f7f\u7528\u65e5\u671f\u51fd\u6570\u3001\u6587\u672c\u51fd\u6570\u4ee5\u53ca\u683c\u5f0f\u5316\u529f\u80fd\u3002\u4e3e\u4f8b [&hellip;]","protected":false},"author":3,"featured_media":137273,"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\/137253"}],"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=137253"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/137253\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/137273"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=137253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=137253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=137253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}