{"id":101,"date":"2024-12-12T06:57:35","date_gmt":"2024-12-11T22:57:35","guid":{"rendered":"https:\/\/lilia-study.com\/lang\/eng\/?p=101"},"modified":"2024-12-12T06:57:36","modified_gmt":"2024-12-11T22:57:36","slug":"countifs","status":"publish","type":"post","link":"https:\/\/lilia-study.com\/lang\/chs\/excel\/excel-vba\/worksheetfunction\/countifs\/","title":{"rendered":"Excel VBA \u5229\u7528\u591a\u4e2a\u6761\u4ef6\u5bf9\u5355\u5143\u683c\u8fdb\u884c\u8ba1\u6570-CountIfs"},"content":{"rendered":"<p><!-- wp:html --><\/p>\n<p><span class=\"icon_point color01\"><\/span>&nbsp;\u672c\u6587\u7531\u65e5\u6587\u8bd1\u6210\u4e2d\u6587\u3002<\/p>\n<p><!-- \/wp:html --><\/p>\n\n\n\n\n<p>\u672c\u6587\u8bb0\u5f55\u4e86\u5982\u4f55\u5728 Excel VBA \u4e2d\u8ba1\u7b97\u7b26\u5408\u591a\u4e2a\u6761\u4ef6\u7684\u5355\u5143\u683c\u6570\uff0c\u201cCount if <strong><em>_ and _<\/em><\/strong>\u201d\u3002<\/p>\n\n\n\n<p>\u8981\u8ba1\u7b97\u7b26\u5408\u591a\u4e2a\u6761\u4ef6\u7684\u5355\u5143\u683c\u6570\uff0c\u8bf7\u4f7f\u7528\u5de5\u4f5c\u8868\u51fd\u6570 \u201cCountIfs\u201d\u3002<\/p>\n\n\n<p><!-- wp:html --><\/p>\n<p style=\"margin-bottom:0;padding-bottom:0;\">&lt;&nbsp;Sponsored Links&nbsp;&gt;<\/p>\n<p><script async=\"\" src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script><br \/>\n<!-- lilia top --><br \/>\n<ins class=\"adsbygoogle\" style=\"display:block\" data-ad-client=\"ca-pub-4504956686889525\" data-ad-slot=\"2727563599\" data-ad-format=\"auto\" data-full-width-responsive=\"true\"><\/ins><br \/>\n<script>\n(adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><br \/>\n<!-- \/wp:html --><\/p>\n\n\n\n\n<h2 class=\"wp-block-heading\">\u53e5\u6cd5 &#8220;CountIfs&#8221;<\/h2>\n\n\n\n<div class=\"box_style box_style_orange\">\n<div class=\"box_inner\">\n<p class=\"b big\">WorksheetFunction.CountIfs(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10, Arg11, Arg12, Arg13, Arg14, Arg15, Arg16, Arg17, Arg18, Arg19, Arg20, Arg21, Arg22, Arg23, Arg24, Arg25, Arg26, Arg27, Arg28, Arg29, Arg30)<\/p>\n<\/div>\n<\/div>\n\n\n\n<p>Arg1 = \u5fc5\u586b\u3002\u6570\u636e\u7c7b\u578b\u4e3a Range\uff0c\u6307\u5b9a\u76f8\u5e94\u6761\u4ef6\u8981\u8bc4\u4f30\u7684\u8303\u56f4\u3002<br>Arg2 = \u5fc5\u586b\uff0c\u6570\u636e\u7c7b\u578b\u4e3a\u53d8\u91cf\u3002\u6570\u636e\u7c7b\u578b\u4e3a\u53d8\u91cf\uff0c\u6307\u5b9a\u5b9a\u4e49\u8981\u8ba1\u7b97\u7684\u5355\u5143\u683c\u7684\u6761\u4ef6\uff0c\u53ef\u4ee5\u662f\u6570\u5b57\u3001\u8868\u8fbe\u5f0f\u3001\u5355\u5143\u683c\u5f15\u7528\u6216\u5b57\u7b26\u4e32\u3002\u4f8b\u5982\uff0c\u641c\u7d22\u6761\u4ef6\u53ef\u4ee5\u662f 32\u3001\u201c32\u2033\u3001\u201dWindows &#8220;\u6216 B4\u3002(\u8868\u8fbe\u5f0f\u548c\u5b57\u7b26\u4e32\u5fc5\u987b\u7528\u5355\u5b57\u8282\u53cc\u5f15\u53f7\uff08&#8221;\uff09\u62ec\u8d77\u6765\u3002<\/p>\n\n\n\n<p>\u8fd4\u56de\u503c \u53cc\u7cbe\u5ea6\u6d6e\u70b9\u7c7b\u578b\uff08\u53cc\uff09<\/p>\n\n\n\n<p>\u8fd4\u56de\u6307\u5b9a\u8303\u56f4\u5185\u7b26\u5408\u591a\u4e2a\u641c\u7d22\u6761\u4ef6\u7684\u5355\u5143\u683c\u6570\u3002<\/p>\n\n\n\n<p>\u53ea\u6709\u4e3a\u5355\u5143\u683c\u6307\u5b9a\u7684\u6240\u6709\u76f8\u5e94\u6761\u4ef6\u5747\u4e3a True \u65f6\uff0c\u624d\u4f1a\u8ba1\u7b97\u8303\u56f4\u5185\u7684\u6bcf\u4e2a\u5355\u5143\u683c\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u4efb\u4f55\u53c2\u6570\u5355\u5143\u683c\u4e3a\u7a7a\u5355\u5143\u683c\uff0cCountIfs \u4f1a\u5c06\u5176\u89c6\u4e3a\u96f6\u503c\u3002<\/p>\n\n\n\n<p>\u3000<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">&#8220;CountIfs&#8221; \u4f7f\u7528\u793a\u4f8b<\/h2>\n\n\n\n<p>\u8ba1\u7b97\u7b26\u5408 D \u5217\u4e3a\u7537\u6027\u548c E \u5217\u4e3a 35 \u5c81\u4ee5\u4e0a\u6761\u4ef6\u7684\u5355\u5143\u683c\uff0c\u5e76\u5c06\u5176\u663e\u793a\u5728\u4e00\u6761\u4fe1\u606f\u4e2d\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro m30-b\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1.125rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.625rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"Sub test()\n  With ActiveSheet\n    MsgBox WorksheetFunction.CountIfs(.Range(&quot;D:D&quot;), &quot;\u7537&quot;, .Range(&quot;E:E&quot;), &quot;&gt;=35&quot;)\n  End With\nEnd Sub\" style=\"color:#d8dee9ff;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">Sub<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">test<\/span><span style=\"color: #ECEFF4\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #81A1C1\">With<\/span><span style=\"color: #D8DEE9FF\"> ActiveSheet<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">MsgBox<\/span><span style=\"color: #D8DEE9FF\"> WorksheetFunction.<\/span><span style=\"color: #88C0D0\">CountIfs<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #88C0D0\">Range<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">D:D<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\">, <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">\u7537<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\">, .<\/span><span style=\"color: #88C0D0\">Range<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">E:E<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\">, <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">&gt;=35<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #88C0D0\">End<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">With<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">End Sub<\/span><\/span><\/code><\/pre><\/div>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/lilia-study.com\/wp-content\/uploads\/2020\/10\/CountIfs01.png\" alt=\"CountIfs\" class=\"wp-image-1074\"\/><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/lilia-study.com\/wp-content\/uploads\/2020\/10\/CountIfs02.png\" alt=\"CountIfs\" class=\"wp-image-1075\"\/><\/figure>\n<\/div>\n\n\n<p>\u3000<\/p>\n\n\n\n<p>\u3000<\/p>\n\n\n<p><!-- wp:html --><\/p>\n<p style=\"margin-bottom:0;padding-bottom:0;\">&lt;&nbsp;Sponsored Links&nbsp;&gt;<\/p>\n<p><script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-4504956686889525\"\n     crossorigin=\"anonymous\"><\/script><br \/>\n<!-- lilia bottom --><br \/>\n<ins class=\"adsbygoogle\"\n     style=\"display:inline-block;width:336px;height:280px\"\n     data-ad-client=\"ca-pub-4504956686889525\"\n     data-ad-slot=\"7848928897\"><\/ins><br \/>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><br \/>\n<!-- \/wp:html --><\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u8bb0\u5f55\u4e86\u5982\u4f55\u5728 Excel VBA \u4e2d\u8ba1\u7b97\u7b26\u5408\u591a\u4e2a\u6761\u4ef6\u7684\u5355\u5143\u683c\u6570\uff0c\u201cCount if _ and _\u201d\u3002 \u8981\u8ba1\u7b97\u7b26\u5408\u591a\u4e2a\u6761\u4ef6\u7684\u5355\u5143\u683c\u6570\uff0c\u8bf7\u4f7f\u7528\u5de5\u4f5c\u8868\u51fd\u6570 \u201cCountIfs\u201d\u3002 \u53e5\u6cd5 &#8220;CountIfs&#038;# [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,2,8],"tags":[],"class_list":{"0":"post-101","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-excel","7":"category-excel-vba","8":"category-worksheetfunction"},"_links":{"self":[{"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/posts\/101","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/comments?post=101"}],"version-history":[{"count":0,"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/posts\/101\/revisions"}],"wp:attachment":[{"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/media?parent=101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/categories?post=101"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/tags?post=101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}