{"id":2699,"date":"2019-02-20T10:33:37","date_gmt":"2019-02-20T02:33:37","guid":{"rendered":"https:\/\/www.aoisnow.net\/blog\/?p=2699"},"modified":"2019-02-20T10:33:37","modified_gmt":"2019-02-20T02:33:37","slug":"day-11094-%e5%85%b3%e4%ba%8eexcel%e4%b8%ad%e5%bd%95%e5%85%a515%e4%bd%8d%e4%bb%a5%e4%b8%8a%e6%95%b0%e5%ad%97%e6%97%b6%ef%bc%88%e4%be%8b%e5%a6%82%e8%ba%ab%e4%bb%bd%e8%af%81%e5%8f%b7%ef%bc%89%ef%bc%8ccou","status":"publish","type":"post","link":"https:\/\/www.aoisnow.net\/blog\/archives\/2699","title":{"rendered":"Day 4768 \u5173\u4e8eExcel\u4e2d\u5f55\u516515\u4f4d\u4ee5\u4e0a\u6570\u5b57\u65f6\uff08\u4f8b\u5982\u8eab\u4efd\u8bc1\u53f7\uff09\uff0cCOUNTIF\u51fd\u6570\u8fd4\u56de\u7684\u7ed3\u679c\u6570\u91cf\u4e0d\u6b63\u786e\u7684\u95ee\u9898"},"content":{"rendered":"<p>\u6700\u8fd1\u5e2e\u540c\u4e8b\u505a\u4e00\u4e2a\u8868\u683c\uff0c\u8981\u6c42\u5728\u5f55\u5165\u6570\u636e\u65f6\uff0c\u81ea\u52a8\u67e5\u627e\u540c\u4e00\u5217\u4e0b\u662f\u5426\u6709\u76f8\u540c\u7684\u503c\uff0c\u6709\u5219\u8fdb\u884c\u63d0\u793a\uff0c\u800c\u9700\u8981\u8fd9\u4e2a\u63d0\u793a\u529f\u80fd\u7684\u5176\u4e2d\u4e00\u5217\u662f\u300e\u8eab\u4efd\u8bc1\u53f7\u300f\u3002<\/p>\n<p>\u4f17\u6240\u5468\u77e5\uff0c\u4e2d\u56fd\u5927\u9646\u5730\u533a\u7684\u8eab\u4efd\u8bc1\u53f7\u662f18\u4f4d\u3002<a href=\"https:\/\/support.microsoft.com\/zh-cn\/help\/78113\/floating-point-arithmetic-may-give-inaccurate-results-in-excel\" target=\"_blank\" rel=\"noopener\">\u9274\u4e8eExcel\u91c7\u7528\u4e86IEEE 754\u7684\u6d6e\u70b9\u6570\u5b58\u50a8\u89c4\u8303<\/a>\uff0c\u5bf9\u4e8e\u6b63\u6574\u6570\u6700\u9ad8\u652f\u6301\u523015\u4f4d\u3002\u8fd9\u4e5f\u662f\u5728Excel\u4e2d\u5f55\u5165\u8eab\u4efd\u8bc1\u53f7\u65f6\uff0c\u5982\u679c\u8eab\u4efd\u8bc1\u53f7\u4e2d\u4e0d\u542bX\uff0c\u7ecf\u5e38\u4f1a\u5728\u6309\u4e0b\u56de\u8f66\u7684\u65f6\u5019\u53d8\u6210\u4e00\u4e32\u79d1\u5b66\u8bb0\u6570\u6cd5\u7684\u539f\u56e0\uff0c\u800c\u5b9e\u9645\u4e0a\u6b64\u65f6\u7b2c16\u4f4d\u8d77\u7684\u6570\u5b57\u5df2\u7ecf\u4e22\u5931\u4e86\u3002<\/p>\n<p>\u5bf9\u4e8e\u53ea\u4f7f\u7528\u8868\u683c\u672c\u8eab\u7684\u573a\u5408\uff0c\u53ef\u4ee5\u7b80\u5355\u5730\u5c06\u5bf9\u5e94\u5355\u5143\u683c\u7684\u6570\u5b57\u683c\u5f0f\u4fee\u6539\u4e3a\u300e\u6587\u672c\u300f\uff0c\u867d\u7136\u8fd9\u6837\u4e00\u6765\u76f8\u5173\u6570\u5b57\u5c31\u4e0d\u80fd\u53c2\u4e0e\u8fd0\u7b97\uff0c\u4f46\u591a\u534a\u4e5f\u6ca1\u6709\u9700\u8981\u5bf9\u8eab\u4efd\u8bc1\u53f7\u8fdb\u884c\u8fd0\u7b97\u7684\u60c5\u5f62\u3002<\/p>\n<p>\u7136\u800c\uff0c\u5f53\u6d89\u53ca\u5230\u4f7f\u7528COUNTIF\u51fd\u6570\u65f6\uff0c\u5373\u4f7f\u5bf9\u5e94\u5355\u5143\u683c\u7684\u6570\u5b57\u683c\u5f0f\u662f\u6587\u672c\uff0cCOUNTIF\u5bf9\u4e8e\u4f20\u5165\u7684\u6570\u636e\u4e5f\u4f1a\u8fdb\u884c\u81ea\u52a8\u7684\u7c7b\u578b\u5224\u65ad\u3002\u8bd5\u89c2\u5bdf\u5982\u4e0bVBA\u8bed\u53e5\uff1a<\/p>\n<blockquote><p>&#8216;sShenfenzheng\u662f\u4e4b\u524d\u4f20\u5165\u7684\u5355\u5143\u683c\u5185\u5bb9\uff08\u8eab\u4efd\u8bc1\u53f7\uff09\uff0c\u53d8\u91cf\u7c7b\u578b\u4e3aString<br \/>\nn = Application.WorksheetFunction.CountIf(Range(&#8220;B1:B65535&#8221;), sShenfenzheng)<\/p><\/blockquote>\n<p>\u6b64\u65f6\u5982\u679c\u5728B\u5217\u4e2d\u5f55\u5165\u5982\u4e0b\u6570\u636e\uff1a<\/p>\n<p>110000199901012333<br \/>\n110000199901012334<br \/>\n110000199901012335<\/p>\n<p>\u7136\u540e\u5bf9sShenfenzheng\u4f20\u5165\u300e110000199901012336\u300f\u7684\u8bdd\uff0cn\u7684\u503c\u5c06\u4f1a\u662f3\uff0c\u800c\u4e0d\u662f\u9884\u671f\u76840\u3002<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/strong><\/p>\n<p>\u5728\u8c03\u7528CountIf\u65f6\uff0c\u5c06\u4f20\u5165\u7684\u67e5\u627e\u76ee\u6807\u540e\u9762\u8ddf\u4e0a\u4e00\u4e2a\u300e*\u300f\uff0c\u5f3a\u5236CountIf\u6309\u7167\u5b57\u7b26\u4e32\u5f62\u5f0f\u5bf9\u6570\u636e\u8fdb\u884c\u67e5\u627e\uff0c\u5373\u53ef\u83b7\u5f97\u6b63\u786e\u7684\u7ed3\u679c\u3002<\/p>\n<p>\u4ee5\u524d\u8ff0\u4ee3\u7801\u4e3a\u4f8b\uff0c\u5e94\u4fee\u6539\u4e3a\uff1a<\/p>\n<blockquote><p>n = Application.WorksheetFunction.CountIf(Range(&#8220;B1:B65535&#8221;), sShenfenzheng &amp; &#8220;*&#8221;)<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u5e2e\u540c\u4e8b\u505a\u4e00\u4e2a\u8868\u683c\uff0c\u8981\u6c42\u5728\u5f55\u5165\u6570\u636e\u65f6\uff0c\u81ea\u52a8\u67e5\u627e\u540c\u4e00\u5217\u4e0b\u662f\u5426\u6709\u76f8\u540c\u7684\u503c\uff0c\u6709\u5219\u8fdb\u884c\u63d0\u793a\uff0c\u800c\u9700\u8981\u8fd9\u4e2a\u63d0\u793a\u529f\u80fd\u7684\u5176\u4e2d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-2699","post","type-post","status-publish","format-standard","hentry","category-sketch"],"_links":{"self":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/posts\/2699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/comments?post=2699"}],"version-history":[{"count":0,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/posts\/2699\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/media?parent=2699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/categories?post=2699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/tags?post=2699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}