{"id":128105,"date":"2021-12-10T12:16:38","date_gmt":"2021-12-10T10:16:38","guid":{"rendered":"https:\/\/learnesy.com\/excelfunksjoner\/countifs\/"},"modified":"2025-08-21T14:22:39","modified_gmt":"2025-08-21T13:22:39","slug":"antall-hvis-sett","status":"publish","type":"excel-functions","link":"https:\/\/learnesy.com\/no\/excelfunksjoner\/antall-hvis-sett\/","title":{"rendered":"ANTALL.HVIS.SETT"},"content":{"rendered":"\n<figure class=\"wp-block-embed is-type-video is-provider-vimeo wp-block-embed-vimeo wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"embed-container\"><iframe loading=\"lazy\" src=\"https:\/\/player.vimeo.com\/video\/432756277?dnt=1&amp;app_id=122963\" width=\"640\" height=\"360\" frameborder=\"0\" allow=\"autoplay; fullscreen; picture-in-picture; clipboard-write; encrypted-media; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\"><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<p><em><strong>Denne leksjonen, og mange andre, finner du i Learnesys fordypningskurs i Excel, <a href=\"https:\/\/learnesy.com\/no\/courses\/excel-fordypning-funksjoner\/\" data-type=\"link\" data-id=\"https:\/\/learnesy.com\/no\/courses\/excel-fordypning-funksjoner\/\">Excelfunksjoner Fordypning<\/a>!<br><\/strong><\/em><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Sammendrag<\/h2>\n\n\n\n<p>Excel-funksjonen <strong>ANTALL.HVIS.SETT<\/strong> returnerer antall celler i et omr\u00e5de som oppfyller ett eller flere angitte kriterier. Hvert kriterium er knyttet til et separat omr\u00e5de og spesifikke betingelser, og alle kriterier m\u00e5 v\u00e6re oppfylt for at en celle skal telles med i resultatet. <strong>ANTALL.HVIS.SETT<\/strong> kan brukes for \u00e5 telle celler som inneholder datoer, tall eller tekst. De angitte kriteriene kan inkludere logiske operatorer og bruk av jokertegn.<\/p>\n\n\n\n<p><strong>ANTALL.HVIS.SETT<\/strong> er en sv\u00e6rt nyttig funksjon som alle Excel-brukere b\u00f8r l\u00e6re seg \u00e5 bruke.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Form\u00e5l<\/h3>\n\n\n\n<p>Returnere antall celler som oppfyller ett eller flere kriterier<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Argumenter<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>kriterieomr\u00e5de1<\/strong> \u2013 det f\u00f8rste omr\u00e5det som skal evalueres<\/li>\n\n\n\n<li><strong>kriterium1<\/strong> \u2013 det f\u00f8rste kriteriet som m\u00e5 oppfylles<\/li>\n\n\n\n<li><strong>[kriterieomr\u00e5de2]<\/strong> \u2013 det andre omr\u00e5det som skal evalueres<\/li>\n\n\n\n<li><strong>[kriterium2]<\/strong> \u2013 det andre kriteriet som m\u00e5 oppfylles<\/li>\n\n\n\n<li>&#8230;<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Returverdi<\/h3>\n\n\n\n<p>Antall celler som oppfyller de angitte kriteriene<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Syntaks<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>=ANTALL.HVIS.SETT(kriterieomr\u00e5de1; kriterium1; &#091;kriterieomr\u00e5de2]; &#091;kriterium2])\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Hvordan bruke ANTALL.HVIS.SETT i Excel?<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Eksempel 1 \u2013 Grunnleggende eksempel<\/h3>\n\n\n\n<p>Nedenfor er et enkelt eksempel p\u00e5 bruk av <strong>ANTALL.HVIS.SETT<\/strong>. Merk at funksjonen ogs\u00e5 kan brukes med kun ett kriterium, p\u00e5 samme m\u00e5te som <strong>ANTALL.HVIS<\/strong>. Her telles antall bestillinger for <strong>B6<\/strong> der betalingsmetoden er lik <strong>2<\/strong>.<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"986\" height=\"783\" src=\"\/wp-content\/uploads\/2023\/11\/excel-antal.omf-1.png\" alt=\"excel-antal.omf-1\" class=\"wp-image-286471\" srcset=\"\/wp-content\/uploads\/2023\/11\/excel-antal.omf-1.png 986w, \/wp-content\/uploads\/2023\/11\/excel-antal.omf-1-300x238.png 300w, \/wp-content\/uploads\/2023\/11\/excel-antal.omf-1-768x610.png 768w\" sizes=\"auto, (max-width: 986px) 100vw, 986px\" \/><figcaption class=\"wp-element-caption\"><em><strong>Eksempel 1: grunnleggende bruk av funksjonen ANTALL.HVIS.SETT med to kriterier.<\/strong><br><br><\/em><\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Eksempel 2 \u2013 ANTALL.HVIS.SETT mellom to datoer<\/h3>\n\n\n\n<p>For \u00e5 telle antall bestillinger mellom to datoer kan du bruke f\u00f8lgende formel:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>=ANTALL.HVIS.SETT(B4:B23;\"&gt;=2022-03-01\";B4:B23;\"&lt;=2022-04-30\")\n<\/code><\/pre>\n\n\n\n<p>Dette vil gi resultatet <strong>3<\/strong>. Merk at operatorene &laquo;st\u00f8rre eller lik&raquo; (&gt;=) og &laquo;mindre eller lik&raquo; (&lt;=) brukes.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Mer om funksjonen ANTALL.HVIS.SETT<\/h2>\n\n\n\n<p>P\u00e5 samme m\u00e5te som <strong>SUMMER.HVIS.SETT<\/strong> kan logiske operatorer (&gt;,&lt;,&lt;&gt;,=) og jokertegn (*,?) for delvis matching brukes med <strong>ANTALL.HVIS.SETT<\/strong>. Noen av de vanligste operatorene vises nedenfor:<\/p>\n\n\n\n<div class=\"wptb-container-legacy\" data-table-id=\"286644\">\n    <table class=\"wptb-preview-table wptb-element-main-table_setting-238775\" data-reconstraction=\"1\" style=\"border: 0px solid rgb(209, 209, 209);\" data-wptb-table-tds-sum-max-width=\"262.40000000000003\" data-wptb-cells-width-auto-count=\"2\" data-wptb-horizontal-scroll-status=\"false\" data-wptb-extra-styles=\"LyogRW50ZXIgeW91ciBjdXN0b20gQ1NTIHJ1bGVzIGhlcmUgKi8=\" role=\"table\" data-wptb-header-background-color=\"#4A4A4AFF\" data-wptb-even-row-background-color=\"#FFFFFFFF\" data-wptb-odd-row-background-color=\"#9B9B9B80\" data-table-columns=\"2\" data-wptb-table-alignment=\"center\"><tbody><tr class=\"wptb-row\" style=\"background-color: rgb(74, 74, 74);\"><td class=\"wptb-cell\" style=\"border: 1px solid rgb(209, 209, 209);\" data-x-index=\"0\" data-y-index=\"0\" data-wptb-css-td-auto-width=\"true\"><div class=\"wptb-text-container wptb-ph-element wptb-element-text-180\" style=\"color: rgb(255, 255, 255); font-size: 15px;\"><div class=\"\" style=\"position: relative;\"><p style=\"text-align: left;\"><strong>R\u00e4kna antal celler<\/strong><\/p><\/div><\/div><\/td><td class=\"wptb-cell\" style=\"border: 1px solid rgb(209, 209, 209);\" data-x-index=\"1\" data-y-index=\"0\" data-wptb-css-td-auto-width=\"true\"><div class=\"wptb-text-container wptb-ph-element wptb-element-text-181\" style=\"color: rgb(255, 255, 255); font-size: 15px;\"><div class=\"\" style=\"position: relative;\"><p style=\"text-align: left;\"><strong>Villkor<\/strong><\/p><\/div><\/div><\/td><\/tr><tr class=\"wptb-row\" style=\"background-color: rgb(255, 255, 255); --hover-bg-color: undefined;\"><td class=\"wptb-cell\" data-y-index=\"1\" data-x-index=\"0\" style=\"border: 1px solid rgb(209, 209, 209);\" data-wptb-css-td-auto-width=\"true\"><div class=\"wptb-text-container wptb-ph-element wptb-element-text-162\" style=\"color: rgb(74, 85, 104); font-size: 15px;\"><div class=\"\" style=\"position: relative;\"><p>Lika med 15 000<\/p><\/div><\/div><\/td><td class=\"wptb-cell\" data-y-index=\"1\" data-x-index=\"1\" style=\"border: 1px solid rgb(209, 209, 209);\" data-wptb-css-td-auto-width=\"true\"><div class=\"wptb-text-container wptb-ph-element wptb-element-text-163\" style=\"color: rgb(74, 85, 104); font-size: 15px;\"><div class=\"\" style=\"position: relative;\"><p>\"15000\" eller 15000<\/p><\/div><\/div><\/td><\/tr><tr class=\"wptb-row\" style=\"background-color: rgba(155, 155, 155, 0.5); --hover-bg-color: undefined;\"><td class=\"wptb-cell\" data-y-index=\"2\" data-x-index=\"0\" style=\"border: 1px solid rgb(209, 209, 209);\" data-wptb-css-td-auto-width=\"true\"><div class=\"wptb-text-container wptb-ph-element wptb-element-text-164\" style=\"color: rgb(74, 85, 104); font-size: 15px;\"><div class=\"\" style=\"position: relative;\"><p>St\u00f6rre \u00e4n 10<\/p><\/div><\/div><\/td><td class=\"wptb-cell\" data-y-index=\"2\" data-x-index=\"1\" style=\"border: 1px solid rgb(209, 209, 209);\" data-wptb-css-td-auto-width=\"true\"><div class=\"wptb-text-container wptb-ph-element wptb-element-text-165\" style=\"color: rgb(74, 85, 104); font-size: 15px;\"><div class=\"\" style=\"position: relative;\"><p>\"&gt;10\"<\/p><\/div><\/div><\/td><\/tr><tr class=\"wptb-row\" style=\"background-color: rgb(255, 255, 255); --hover-bg-color: undefined;\"><td class=\"wptb-cell\" data-y-index=\"3\" data-x-index=\"0\" style=\"border: 1px solid rgb(209, 209, 209);\" data-wptb-css-td-auto-width=\"true\"><div class=\"wptb-text-container wptb-ph-element wptb-element-text-166\" style=\"color: rgb(74, 85, 104); font-size: 15px;\"><div class=\"\" style=\"position: relative;\"><p>Mindre eller lika med 70<\/p><\/div><\/div><\/td><td class=\"wptb-cell\" data-y-index=\"3\" data-x-index=\"1\" style=\"border: 1px solid rgb(209, 209, 209);\" data-wptb-css-td-auto-width=\"true\"><div class=\"wptb-text-container wptb-ph-element wptb-element-text-167\" style=\"color: rgb(74, 85, 104); font-size: 15px;\"><div class=\"\" style=\"position: relative;\"><p>\"&lt;=70\"<\/p><\/div><\/div><\/td><\/tr><tr class=\"wptb-row\" style=\"background-color: rgba(155, 155, 155, 0.5); --hover-bg-color: undefined;\"><td class=\"wptb-cell\" data-y-index=\"4\" data-x-index=\"0\" style=\"border: 1px solid rgb(209, 209, 209);\" data-wptb-css-td-auto-width=\"true\"><div class=\"wptb-text-container wptb-ph-element wptb-element-text-168\" style=\"color: rgb(74, 85, 104); font-size: 15px;\"><div class=\"\" style=\"position: relative;\"><p>Som \u00e4r lika med \"debit\"<\/p><\/div><\/div><\/td><td class=\"wptb-cell\" data-y-index=\"4\" data-x-index=\"1\" style=\"border: 1px solid rgb(209, 209, 209);\" data-wptb-css-td-auto-width=\"true\"><div class=\"wptb-text-container wptb-ph-element wptb-element-text-169\" style=\"color: rgb(74, 85, 104); font-size: 15px;\"><div class=\"\"><p>\"debit\"<\/p><\/div><\/div><\/td><\/tr><tr class=\"wptb-row\" style=\"background-color: rgb(255, 255, 255); --hover-bg-color: undefined;\"><td class=\"wptb-cell\" data-y-index=\"5\" data-x-index=\"0\" style=\"border: 1px solid rgb(209, 209, 209);\" data-wptb-css-td-auto-width=\"true\"><div class=\"wptb-text-container wptb-ph-element wptb-element-text-170\" style=\"color: rgb(74, 85, 104); font-size: 15px;\"><div class=\"\" style=\"position: relative;\"><p>Som inte \u00e4r lika med \"Lindesberg\"<\/p><\/div><\/div><\/td><td class=\"wptb-cell\" data-y-index=\"5\" data-x-index=\"1\" style=\"border: 1px solid rgb(209, 209, 209);\" data-wptb-css-td-auto-width=\"true\"><div class=\"wptb-text-container wptb-ph-element wptb-element-text-171\" style=\"color: rgb(74, 85, 104); font-size: 15px;\"><div class=\"\" style=\"position: relative;\"><p>\"&lt;&gt;Lindesberg\"<\/p><\/div><\/div><\/td><\/tr><tr class=\"wptb-row\" style=\"background-color: rgba(155, 155, 155, 0.5); --hover-bg-color: undefined;\"><td class=\"wptb-cell\" data-y-index=\"6\" data-x-index=\"0\" style=\"border: 1px solid rgb(209, 209, 209);\" data-wptb-css-td-auto-width=\"true\"><div class=\"wptb-text-container wptb-ph-element wptb-element-text-172\" style=\"color: rgb(74, 85, 104); font-size: 15px;\"><div class=\"\" style=\"position: relative;\"><p>Som \u00e4r tomma<\/p><\/div><\/div><\/td><td class=\"wptb-cell\" data-y-index=\"6\" data-x-index=\"1\" style=\"border: 1px solid rgb(209, 209, 209);\" data-wptb-css-td-auto-width=\"true\"><div class=\"wptb-text-container wptb-ph-element wptb-element-text-173\" style=\"color: rgb(74, 85, 104); font-size: 15px;\"><div class=\"\" style=\"position: relative;\"><p>\"\"<\/p><\/div><\/div><\/td><\/tr><tr class=\"wptb-row\" style=\"background-color: rgb(255, 255, 255); --hover-bg-color: undefined;\"><td class=\"wptb-cell\" data-y-index=\"7\" data-x-index=\"0\" style=\"border: 1px solid rgb(209, 209, 209);\" data-wptb-css-td-auto-width=\"true\"><div class=\"wptb-text-container wptb-ph-element wptb-element-text-174\" style=\"color: rgb(74, 85, 104); font-size: 15px;\"><div class=\"\" style=\"position: relative;\"><p>Som b\u00f6rjar med \"a\"<\/p><\/div><\/div><\/td><td class=\"wptb-cell\" data-y-index=\"7\" data-x-index=\"1\" style=\"border: 1px solid rgb(209, 209, 209);\" data-wptb-css-td-auto-width=\"true\"><div class=\"wptb-text-container wptb-ph-element wptb-element-text-175\" style=\"color: rgb(74, 85, 104); font-size: 15px;\"><div class=\"\" style=\"position: relative;\"><p>\"a*\"<\/p><\/div><\/div><\/td><\/tr><tr class=\"wptb-row\" style=\"background-color: rgba(155, 155, 155, 0.5); --hover-bg-color: undefined;\"><td class=\"wptb-cell\" data-y-index=\"8\" data-x-index=\"0\" style=\"border: 1px solid rgb(209, 209, 209);\" data-wptb-css-td-auto-width=\"true\"><div class=\"wptb-text-container wptb-ph-element wptb-element-text-176\" style=\"color: rgb(74, 85, 104); font-size: 15px;\"><div class=\"\" style=\"position: relative;\"><p>St\u00f6rre \u00e4n B2 (cellreferens)<\/p><\/div><\/div><\/td><td class=\"wptb-cell\" data-y-index=\"8\" data-x-index=\"1\" style=\"border: 1px solid rgb(209, 209, 209);\" data-wptb-css-td-auto-width=\"true\"><div class=\"wptb-text-container wptb-ph-element wptb-element-text-177\" style=\"color: rgb(74, 85, 104); font-size: 15px;\"><div class=\"\" style=\"position: relative;\"><p>\"&gt;\"&amp;B2<\/p><\/div><\/div><\/td><\/tr><tr class=\"wptb-row\" style=\"background-color: rgb(255, 255, 255); --hover-bg-color: undefined;\"><td class=\"wptb-cell\" data-y-index=\"9\" data-x-index=\"0\" style=\"border: 1px solid rgb(209, 209, 209);\" data-wptb-css-td-auto-width=\"true\"><div class=\"wptb-text-container wptb-ph-element wptb-element-text-178\" style=\"color: rgb(74, 85, 104); font-size: 15px;\"><div class=\"\" style=\"position: relative;\"><p>Innan ett visst datum<\/p><\/div><\/div><\/td><td class=\"wptb-cell\" data-y-index=\"9\" data-x-index=\"1\" style=\"border: 1px solid rgb(209, 209, 209);\" data-wptb-css-td-auto-width=\"true\"><div class=\"wptb-text-container wptb-ph-element wptb-element-text-179\" style=\"color: rgb(74, 85, 104); font-size: 15px;\"><div class=\"\" style=\"position: relative;\"><p>\"&lt;\"&amp;IDAG()<\/p><\/div><\/div><\/td><\/tr><\/tbody><\/table>\n<\/div>\n\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Bra \u00e5 vite om ANTALL.HVIS.SETT<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Kriterier i <strong>ANTALL.HVIS.SETT<\/strong> kobles sammen med <strong>OG-logikk<\/strong>. Med andre ord m\u00e5 alle kriterier v\u00e6re sanne for at en celle skal telles.<\/li>\n\n\n\n<li><strong>ANTALL.HVIS.SETT<\/strong> krever faktiske omr\u00e5der for alle omr\u00e5dereferanser; du kan ikke bruke en matrise.<\/li>\n\n\n\n<li><strong>ANTALL.HVIS.SETT<\/strong> er ikke <strong>skiftf\u00f8lsom<\/strong>. For \u00e5 telle verdier basert p\u00e5 et skiftf\u00f8lsomt kriterium kan du i stedet bruke en formel med <strong>PRODUKTSUMMA<\/strong> og funksjonen <strong>EKSAKT<\/strong>.<\/li>\n\n\n\n<li>Alle omr\u00e5der m\u00e5 ha samme st\u00f8rrelse; ellers vil <strong>ANTALL.HVIS.SETT<\/strong> returnere <strong>#VERDI!<\/strong><\/li>\n\n\n\n<li>Kriteriene m\u00e5 normalt st\u00e5 i doble anf\u00f8rselstegn (f.eks. &laquo;&lt;100&raquo;, &laquo;>32&raquo;, &laquo;TX&raquo;).<\/li>\n\n\n\n<li>Kriteriene kan inkludere jokertegn &laquo;?&raquo; og &laquo;*&raquo; samt &laquo;~&raquo;.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Mer lesing<\/h3>\n\n\n\n<p>Du l\u00e6rer mer om <strong>ANTALL.HVIS.SETT<\/strong> i kursene <a href=\"https:\/\/learnesy.com\/no\/courses\/excelkurs-bas-norsk\/\" data-type=\"link\" data-id=\"https:\/\/learnesy.com\/no\/courses\/excelkurs-bas-norsk\/\"><em>Excelkurs Bas<\/em>is<\/a> og<a href=\"https:\/\/learnesy.com\/no\/courses\/excel-fordypning-funksjoner\/\" data-type=\"link\" data-id=\"https:\/\/learnesy.com\/no\/courses\/excel-fordypning-funksjoner\/\"> <em>Excelfunksjoner Fordypning<\/em><\/a>.<\/p>\n\n\n\n<p>Flere Excel-tips finner du p\u00e5 Learnesys <a href=\"https:\/\/learnesy.com\/no\/blogg\/\" data-type=\"link\" data-id=\"https:\/\/learnesy.com\/no\/blogg\/\">blogg <\/a>\u2013 eller abonner p\u00e5 v\u00e5rt <a href=\"https:\/\/learnesy.com\/newsletter\/\" data-type=\"link\" data-id=\"https:\/\/learnesy.com\/newsletter\/\">nyhetsbrev<\/a>.<\/p>\n\n\n\n<p><a href=\"https:\/\/learnesy.com\/no\/courses\/\" data-type=\"link\" data-id=\"https:\/\/learnesy.com\/no\/courses\/\">Til v\u00e5re kurssider \u2192<\/a><\/p>\n","protected":false},"featured_media":0,"menu_order":0,"template":"","excel_function_category":[314],"class_list":["post-128105","excel-functions","type-excel-functions","status-publish","hentry","excel_function_category-antall-sum"],"acf":[],"_links":{"self":[{"href":"https:\/\/learnesy.com\/no\/wp-json\/wp\/v2\/excel-functions\/128105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learnesy.com\/no\/wp-json\/wp\/v2\/excel-functions"}],"about":[{"href":"https:\/\/learnesy.com\/no\/wp-json\/wp\/v2\/types\/excel-functions"}],"wp:attachment":[{"href":"https:\/\/learnesy.com\/no\/wp-json\/wp\/v2\/media?parent=128105"}],"wp:term":[{"taxonomy":"excel_function_category","embeddable":true,"href":"https:\/\/learnesy.com\/no\/wp-json\/wp\/v2\/excel_function_category?post=128105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}