Deprecated: Creation of dynamic property CF\WordPress\DataStore::$logger is deprecated in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php on line 23

Deprecated: Creation of dynamic property CF\WordPress\Proxy::$pluginAPI is deprecated in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/Proxy.php on line 31

Deprecated: file_get_contents(): Passing null to parameter #2 ($use_include_path) of type bool is deprecated in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/codelights-shortcodes-and-widgets/codelights.php on line 20

Warning: session_start(): Session cannot be started after headers have already been sent in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/automatic-video-posts/vendor/ternstyle/wordpress/src/class/wordpress.php on line 53

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Deprecated: Creation of dynamic property ternplugin\youtube_video::$post is deprecated in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/automatic-video-posts/vendor/ternstyle/plugin/src/class/youtube_video.php on line 64

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-content/plugins/cloudflare/src/WordPress/DataStore.php:23) in /home1/cassanoc/public_html/bonbonsguide.com/wp/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":1673,"date":"2019-08-23T12:09:33","date_gmt":"2019-08-23T19:09:33","guid":{"rendered":"https:\/\/bonbonsguide.com\/wp\/?p=1673"},"modified":"2022-01-03T14:53:29","modified_gmt":"2022-01-03T21:53:29","slug":"power-query-filter-rows-by-not-contains-criteria-single-formula-solution-excel-magic-trick-1593","status":"publish","type":"post","link":"https:\/\/bonbonsguide.com\/wp\/blog\/2019\/08\/power-query-filter-rows-by-not-contains-criteria-single-formula-solution-excel-magic-trick-1593\/","title":{"rendered":"Power Query Filter Rows by NOT Contains Criteria – Single Formula Solution"},"content":{"rendered":"

Learn how to filter a table based on NOT Contains Criteria. Download an example workbook here.<\/a><\/p>\n

Easy step by step instructions below.\u00a0 See a single formula solution using the functions Splitter.SplitByAnyDelimiter, List.Count and Table.SelectRows. Amazing formula solution from Power Query Poet, Bill Szysz.<\/p>\n

Please watch the video if you’d like for a guided walkthrough and also another method that can be useful for multiple tables.\u00a0\u00a0<\/p>\n

Criteria Table<\/strong><\/p>\n

\n
    \n
  1. Create a new, separate table with the list of terms you will want to exclude. Name the table \u201cNoCriteria\u201d.<\/li>\n
  2. Add the excluded item (NoCriteria) table to Power Query – click within table, under Data menu, choose From Table\/Range, which is in the Get and Transform data section.<\/li>\n
  3. In the Power Query window, select the Transform menu and click convert to list.<\/li>\n
  4. Under the File menu, choose Close and Load To, then choose Connection Only.<\/li>\n<\/ol>\n

    Building the Filtering via Power Query<\/strong><\/p>\n

      \n
    1. Add or create the list\/table that will ultimately be filtered.<\/li>\n
    2. Click any cell within the table that will be filtered. Add the excluded item table to Power Query (click within table, under Data menu, choose From Table\/Range, which is in the Get and Transform data section).<\/li>\n
    3. In the Power Query window, click the Add Column menu, and select Custom Column.<\/li>\n
    4. In the window that opens, type this:
      \n
      \n

      = Table.SelectRows(#”Changed Type”, each List.Count (Splitter.SplitTextByAnyDelimiter(NoCriteria)([PRODUCT_NAME]))=1)<\/strong><\/p>\n<\/blockquote>\n<\/li>\n

    5. Change [PRODUCT_NAME] in that text to your own column in the table that you will be filtering on if it is different.<\/li>\n
    6. Select the statement you have typed in and copy it (you will need to paste this formula in a following step).<\/li>\n
    7. Click OK. You will see that the formula you typed was changed by the program and a column was added.<\/li>\n
    8. To change the formula back, click the menu bar, highlight the entire text and then replace by pasting in the formula you copied. Hit enter.<\/li>\n
    9. The extra column should be removed and the table should be filtered on you criteria from the NoCriteria table.<\/li>\n
    10. Click the File menu, choose Close and Load To, then choose where you would like the newly filtered table loaded to.<\/li>\n<\/ol>\n

      Any time changes are made to the exclusion list, you will need to refresh the filtered table. Simply right click any cell within the filtered table, and select Refresh<\/strong>.<\/p>\n

      \u00a0<\/p>\n

      Bonus – Filtered table with the excluded items only (not shown in video)<\/strong><\/span><\/p>\n

      You can additionally create a filtered table that only includes the terms in your NoCriteria table!\u00a0\u00a0<\/p>\n

        \n
      1. To do this, go into Power Query.\u00a0 Right click on your filtered table and click Duplicate.<\/li>\n
      2. In that new table, you will very slightly change the existing formula in your Power Query to not equal one (see orange text):
        \n
        \n

        = Table.SelectRows(#”Changed Type”, each List.Count (Splitter.SplitTextByAnyDelimiter(NoCriteria)([PRODUCT_NAME]))<>1<\/strong><\/span>)<\/p>\n<\/blockquote>\n<\/li>\n

      3. Hit enter.\u00a0 The table should now only filter on the items in your exclusion list, instead of including them.<\/li>\n
      4. Click the File menu, choose Close and Load To, then choose where you would like the newly filtered table loaded to.<\/li>\n<\/ol>\n<\/div>\n