﻿{"id":3868,"date":"2013-09-22T22:00:26","date_gmt":"2013-09-22T13:00:26","guid":{"rendered":"http:\/\/fujiitoshiki.com\/improvesociety\/?p=3868"},"modified":"2017-04-27T16:08:06","modified_gmt":"2017-04-27T07:08:06","slug":"how-to-compare-and-get-differences-between-2-arrays-in-excel-vba","status":"publish","type":"post","link":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3868","title":{"rendered":"How to compare and get differences between 2 arrays in EXCEL VBA?"},"content":{"rendered":"<div class=\"theContentWrap-ccc\"><p>When you&#8217;d like to compare 2 arrays in EXCEL VBA whether they are equal or not, what would you do? Furthermore, you might get different elements that don&#8217;t overlap each other. I&#8217;d like to describe the code that how to get differences of 2 arrays. <\/p>\n<p>At first, you would have to check whether they are equal each other or not because the difference of equal arrays is empty set. Next, you would have to check whether an array is proper subset of another array or not. At last, you could get difference between 2 arrays. <\/p>\n<p><a href=\"\/\/fujiitoshiki.com\/improvesociety\/wp-content\/uploads\/Array1Array2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/fujiitoshiki.com\/improvesociety\/wp-content\/uploads\/Array1Array2-300x200.png\" alt=\"Array1&amp;Array2\" width=\"300\" height=\"200\" class=\"alignnone size-medium wp-image-3850\" srcset=\"https:\/\/www.fujiitoshiki.com\/improvesociety\/wp-content\/uploads\/Array1Array2-300x200.png 300w, https:\/\/www.fujiitoshiki.com\/improvesociety\/wp-content\/uploads\/Array1Array2-100x66.png 100w, https:\/\/www.fujiitoshiki.com\/improvesociety\/wp-content\/uploads\/Array1Array2.png 301w\" sizes=\"auto, (max-width: 300px) 85vw, 300px\" \/><\/a><\/p>\n<p>See formula as below, it is shown all elements of Array1 as &#8220;A&#8221;, all elements of Array2 as &#8220;B&#8221; and differences elements from Array1 and Array2 as &#8220;A And (not B)&#8221;. <\/p>\n<p><img src='https:\/\/s0.wp.com\/latex.php?latex=Array1+-+Array2+%3D+A%5C+AND%5C+%28not+B%29+%3D+A+%5Ccap+%5Cneg+B&#038;bg=T&#038;fg=000000&#038;s=0' alt='Array1 - Array2 = A\\ AND\\ (not B) = A \\cap \\neg B' title='Array1 - Array2 = A\\ AND\\ (not B) = A \\cap \\neg B' class='latex' \/><\/p>\n<\/p>\n<p>The following code compares elements between two set and get number of equal elements with double loop, that means to get intersection of 2 sets. <\/p>\n<pre class=\"toolbar-overlay:true lang:vb decode:true\">Option Explicit\r\n\r\nFunction COMPARE_ARRAY(ByRef Array1() As String, ByRef Array2() As String) As Boolean\r\n    Dim i   As Long\r\n    Dim j   As Long\r\n    Dim k   As Long\r\n    k = 0\r\n    For i = LBound(Array1) To UBound(Array1)\r\n        For j = LBound(Array2) To UBound(Array2)\r\n            If Array1(i) = Array2(j) Then\r\n                k = k + 1\r\n            End If\r\n        Next j\r\n    Next i\r\n    If i = j And i = k Then\r\n        COMPARE_ARRAY = True\r\n    Else\r\n        COMPARE_ARRAY = False\r\n    End If\r\nEnd Function\r\n\r\nFunction PROPERSUBSET_ARRAY(ByRef Array1() As String, ByRef Array2() As String) As Boolean\r\n    Dim i   As Long\r\n    Dim j   As Long\r\n    Dim k   As Long\r\n    k = 0\r\n    For i = LBound(Array1) To UBound(Array1)\r\n        For j = LBound(Array2) To UBound(Array2)\r\n            If Array1(i) = Array2(j) Then\r\n                k = k + 1\r\n            End If\r\n        Next j\r\n    Next i\r\n    If k = i Then\r\n        PROPERSUBSET_ARRAY = True\r\n    Else\r\n        PROPERSUBSET_ARRAY = False\r\n    End If\r\nEnd Function\r\n<\/pre>\n<p>Configuration of the 3rd argument &#8220;Compare&#8221; specifies which array should be excepted, when it was TRUE the function would except the latter from the former, when it was FALSE then it would except the former from the latter, respectively. It&#8217;s assumed that the elements of arrays has no empty string. <\/p>\n<pre class=\"toolbar-overlay:true lang:vb decode:true\">\r\nFunction EXCEPT_ARRAY(ByRef Array1() As String, ByRef Array2() As String, ByVal Compare As Boolean) As String()\r\n    Dim i               As Long\r\n    Dim j               As Long\r\n    Dim k               As Long\r\n    Dim InternalAr1()   As String\r\n    Dim InternalAr2()   As String\r\n    Dim Ar1Ar()         As String\r\n    Dim Ar2Ar()         As String\r\n    InternalAr1 = Array1\r\n    InternalAr2 = Array2\r\n    For i = LBound(InternalAr1) To UBound(InternalAr1)\r\n        For j = LBound(InternalAr2) To UBound(InternalAr2)\r\n            If InternalAr1(i) = InternalAr2(j) Then\r\n                InternalAr1(i) = \"\"\r\n                InternalAr2(j) = \"\"\r\n                k = k + 1\r\n            End If\r\n        Next j\r\n    Next i\r\n    k = 0\r\n    For i = LBound(InternalAr1) To UBound(InternalAr1)\r\n        If InternalAr1(i) = \"\" Then\r\n        Else\r\n            ReDim Preserve Ar1Ar(k)\r\n            Ar1Ar(k) = InternalAr1(i)\r\n            k = k + 1\r\n        End If\r\n    Next i\r\n    k = 0\r\n    For j = LBound(InternalAr2) To UBound(InternalAr2)\r\n        If InternalAr2(j) = \"\" Then\r\n        Else\r\n            ReDim Preserve Ar2Ar(k)\r\n            Ar2Ar(k) = InternalAr2(j)\r\n            k = k + 1\r\n        End If\r\n    Next j\r\n    If Compare Then\r\n        EXCEPT_ARRAY = Ar1Ar\r\n    Else\r\n        EXCEPT_ARRAY = Ar2Ar\r\n    End If\r\nEnd Function\r\n<\/pre>\n<p>REFERENCE:<br \/>\n<a href=\"\/\/fujiitoshiki.com\/improvesociety\/?p=3457\" target=\"_blank\">How to get first cell which is referred to formula and last cell which refers to formula in Excel worksheet?<\/a><\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>When you&#8217;d like to compare 2 arrays in EXCEL VBA whether they are equal or not, what would you do? Furth &hellip; <a href=\"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3868\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;How to compare and get differences between 2 arrays in EXCEL VBA?&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":6026,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[6],"tags":[315,316,603,317,318,320,319,153],"class_list":["post-3868","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-excel","tag-array","tag-difference","tag-excel","tag-except","tag-intersection","tag-proper-subset","tag-union","tag-vba"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"When you&#039;d like to compare 2 arrays in EXCEL VBA whether they are equal or not, what would you do? Furthermore, you might get different elements that don&#039;t overlap each other. I&#039;d like to describe the code that how to get differences of 2 arrays.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"admin\"\/>\n\t<meta name=\"keywords\" content=\"excel,vba,array,difference,except,intersection,union,proper subset\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3868\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"ja_JP\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Improve Society | with Database, Statistics and Nutrition\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"How to compare and get differences between 2 arrays in EXCEL VBA? | Improve Society\" \/>\n\t\t<meta property=\"og:description\" content=\"When you&#039;d like to compare 2 arrays in EXCEL VBA whether they are equal or not, what would you do? Furthermore, you might get different elements that don&#039;t overlap each other. I&#039;d like to describe the code that how to get differences of 2 arrays.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3868\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2013-09-22T13:00:26+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2017-04-27T07:08:06+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"How to compare and get differences between 2 arrays in EXCEL VBA? | Improve Society\" \/>\n\t\t<meta name=\"twitter:description\" content=\"When you&#039;d like to compare 2 arrays in EXCEL VBA whether they are equal or not, what would you do? Furthermore, you might get different elements that don&#039;t overlap each other. I&#039;d like to describe the code that how to get differences of 2 arrays.\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?p=3868#article\",\"name\":\"How to compare and get differences between 2 arrays in EXCEL VBA? | Improve Society\",\"headline\":\"How to compare and get differences between 2 arrays in EXCEL VBA?\",\"author\":{\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?author=1#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/wp-content\\\/uploads\\\/SpreadSheetIcon.jpg\",\"width\":225,\"height\":225},\"datePublished\":\"2013-09-22T22:00:26+09:00\",\"dateModified\":\"2017-04-27T16:08:06+09:00\",\"inLanguage\":\"ja\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?p=3868#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?p=3868#webpage\"},\"articleSection\":\"EXCEL, array, difference, EXCEL, except, intersection, proper subset, union, VBA\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?p=3868#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?cat=6#listItem\",\"name\":\"EXCEL\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?cat=6#listItem\",\"position\":2,\"name\":\"EXCEL\",\"item\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?cat=6\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?p=3868#listItem\",\"name\":\"How to compare and get differences between 2 arrays in EXCEL VBA?\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?p=3868#listItem\",\"position\":3,\"name\":\"How to compare and get differences between 2 arrays in EXCEL VBA?\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?cat=6#listItem\",\"name\":\"EXCEL\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/#person\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?p=3868#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ae816121e2fdbfad4bfba7268a6d5a7910d91a047394738018fa9b82a7da661?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"admin\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?author=1#author\",\"url\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?author=1\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?p=3868#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ae816121e2fdbfad4bfba7268a6d5a7910d91a047394738018fa9b82a7da661?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"admin\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?p=3868#webpage\",\"url\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?p=3868\",\"name\":\"How to compare and get differences between 2 arrays in EXCEL VBA? | Improve Society\",\"description\":\"When you'd like to compare 2 arrays in EXCEL VBA whether they are equal or not, what would you do? Furthermore, you might get different elements that don't overlap each other. I'd like to describe the code that how to get differences of 2 arrays.\",\"inLanguage\":\"ja\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?p=3868#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?author=1#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?author=1#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/wp-content\\\/uploads\\\/SpreadSheetIcon.jpg\",\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?p=3868\\\/#mainImage\",\"width\":225,\"height\":225},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/?p=3868#mainImage\"},\"datePublished\":\"2013-09-22T22:00:26+09:00\",\"dateModified\":\"2017-04-27T16:08:06+09:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/#website\",\"url\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/\",\"name\":\"Improve Society\",\"description\":\"with Database, Statistics and Nutrition\",\"inLanguage\":\"ja\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.fujiitoshiki.com\\\/improvesociety\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"How to compare and get differences between 2 arrays in EXCEL VBA? | Improve Society","description":"When you'd like to compare 2 arrays in EXCEL VBA whether they are equal or not, what would you do? Furthermore, you might get different elements that don't overlap each other. I'd like to describe the code that how to get differences of 2 arrays.","canonical_url":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3868","robots":"max-image-preview:large","keywords":"excel,vba,array,difference,except,intersection,union,proper subset","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3868#article","name":"How to compare and get differences between 2 arrays in EXCEL VBA? | Improve Society","headline":"How to compare and get differences between 2 arrays in EXCEL VBA?","author":{"@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?author=1#author"},"publisher":{"@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/#person"},"image":{"@type":"ImageObject","url":"https:\/\/www.fujiitoshiki.com\/improvesociety\/wp-content\/uploads\/SpreadSheetIcon.jpg","width":225,"height":225},"datePublished":"2013-09-22T22:00:26+09:00","dateModified":"2017-04-27T16:08:06+09:00","inLanguage":"ja","mainEntityOfPage":{"@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3868#webpage"},"isPartOf":{"@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3868#webpage"},"articleSection":"EXCEL, array, difference, EXCEL, except, intersection, proper subset, union, VBA"},{"@type":"BreadcrumbList","@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3868#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.fujiitoshiki.com\/improvesociety#listItem","position":1,"name":"Home","item":"https:\/\/www.fujiitoshiki.com\/improvesociety","nextItem":{"@type":"ListItem","@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?cat=6#listItem","name":"EXCEL"}},{"@type":"ListItem","@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?cat=6#listItem","position":2,"name":"EXCEL","item":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?cat=6","nextItem":{"@type":"ListItem","@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3868#listItem","name":"How to compare and get differences between 2 arrays in EXCEL VBA?"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.fujiitoshiki.com\/improvesociety#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3868#listItem","position":3,"name":"How to compare and get differences between 2 arrays in EXCEL VBA?","previousItem":{"@type":"ListItem","@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?cat=6#listItem","name":"EXCEL"}}]},{"@type":"Person","@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/#person","name":"admin","image":{"@type":"ImageObject","@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3868#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/4ae816121e2fdbfad4bfba7268a6d5a7910d91a047394738018fa9b82a7da661?s=96&d=mm&r=g","width":96,"height":96,"caption":"admin"}},{"@type":"Person","@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?author=1#author","url":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?author=1","name":"admin","image":{"@type":"ImageObject","@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3868#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/4ae816121e2fdbfad4bfba7268a6d5a7910d91a047394738018fa9b82a7da661?s=96&d=mm&r=g","width":96,"height":96,"caption":"admin"}},{"@type":"WebPage","@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3868#webpage","url":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3868","name":"How to compare and get differences between 2 arrays in EXCEL VBA? | Improve Society","description":"When you'd like to compare 2 arrays in EXCEL VBA whether they are equal or not, what would you do? Furthermore, you might get different elements that don't overlap each other. I'd like to describe the code that how to get differences of 2 arrays.","inLanguage":"ja","isPartOf":{"@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/#website"},"breadcrumb":{"@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3868#breadcrumblist"},"author":{"@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?author=1#author"},"creator":{"@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?author=1#author"},"image":{"@type":"ImageObject","url":"https:\/\/www.fujiitoshiki.com\/improvesociety\/wp-content\/uploads\/SpreadSheetIcon.jpg","@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3868\/#mainImage","width":225,"height":225},"primaryImageOfPage":{"@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3868#mainImage"},"datePublished":"2013-09-22T22:00:26+09:00","dateModified":"2017-04-27T16:08:06+09:00"},{"@type":"WebSite","@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/#website","url":"https:\/\/www.fujiitoshiki.com\/improvesociety\/","name":"Improve Society","description":"with Database, Statistics and Nutrition","inLanguage":"ja","publisher":{"@id":"https:\/\/www.fujiitoshiki.com\/improvesociety\/#person"}}]},"og:locale":"ja_JP","og:site_name":"Improve Society | with Database, Statistics and Nutrition","og:type":"article","og:title":"How to compare and get differences between 2 arrays in EXCEL VBA? | Improve Society","og:description":"When you'd like to compare 2 arrays in EXCEL VBA whether they are equal or not, what would you do? Furthermore, you might get different elements that don't overlap each other. I'd like to describe the code that how to get differences of 2 arrays.","og:url":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3868","article:published_time":"2013-09-22T13:00:26+00:00","article:modified_time":"2017-04-27T07:08:06+00:00","twitter:card":"summary","twitter:title":"How to compare and get differences between 2 arrays in EXCEL VBA? | Improve Society","twitter:description":"When you'd like to compare 2 arrays in EXCEL VBA whether they are equal or not, what would you do? Furthermore, you might get different elements that don't overlap each other. I'd like to describe the code that how to get differences of 2 arrays."},"aioseo_meta_data":{"post_id":"3868","title":"How to compare and get differences between 2 arrays in EXCEL VBA? | #site_title","description":"When you'd like to compare 2 arrays in EXCEL VBA whether they are equal or not, what would you do? Furthermore, you might get different elements that don't overlap each other. I'd like to describe the code that how to get differences of 2 arrays.","keywords":[{"label":"EXCEL","value":"EXCEL"},{"label":"VBA","value":"VBA"},{"label":"array","value":"array"},{"label":"difference","value":"difference"},{"label":"except","value":"except"},{"label":"intersection","value":"intersection"},{"label":"union","value":"union"},{"label":"proper subset","value":"proper subset"}],"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2020-12-21 23:41:52","updated":"2025-06-04 05:05:25","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.fujiitoshiki.com\/improvesociety\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.fujiitoshiki.com\/improvesociety\/?cat=6\" title=\"EXCEL\">EXCEL<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHow to compare and get differences between 2 arrays in EXCEL VBA?\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.fujiitoshiki.com\/improvesociety"},{"label":"EXCEL","link":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?cat=6"},{"label":"How to compare and get differences between 2 arrays in EXCEL VBA?","link":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=3868"}],"_links":{"self":[{"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/posts\/3868","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3868"}],"version-history":[{"count":10,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/posts\/3868\/revisions"}],"predecessor-version":[{"id":3879,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/posts\/3868\/revisions\/3879"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/media\/6026"}],"wp:attachment":[{"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3868"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3868"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3868"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}