{"id":31759,"date":"2023-11-06T22:34:58","date_gmt":"2023-11-06T21:34:58","guid":{"rendered":"https:\/\/www.myexcelonline.com\/?p=31759"},"modified":"2024-03-22T18:06:44","modified_gmt":"2024-03-22T17:06:44","slug":"power-query-if-statement","status":"publish","type":"post","link":"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/power-query-if-statement\/","title":{"rendered":"How to Write Power Query IF Statement in Excel &#8211; 2 Easy Examples"},"content":{"rendered":"<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/8D65160C-5F6B-4186-8F89-0F0A8778D848.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-31814\" title=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/8D65160C-5F6B-4186-8F89-0F0A8778D848-1024x576.png\" alt=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" width=\"1024\" height=\"576\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/8D65160C-5F6B-4186-8F89-0F0A8778D848-1024x576.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/8D65160C-5F6B-4186-8F89-0F0A8778D848-300x169.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/8D65160C-5F6B-4186-8F89-0F0A8778D848-768x432.png 768w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/11\/8D65160C-5F6B-4186-8F89-0F0A8778D848.png 1280w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/power-query-in-excel\/\" target=\"_blank\" rel=\"nofollow noopener\"><strong>Power Query<\/strong><\/a> is a new add-in introduced in Excel 2013 by Microsoft that <strong>accesses, cleans, and transforms all that messy data and displays it in a way that Excel loves and can work with<\/strong>. A particularly powerful feature is the <a class=\"wpil_keyword_link\" title=\"Power Query\" href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/50-things-you-can-do-with-excel-power-query\/\" target=\"_blank\" rel=\"noopener\" data-wpil-keyword-link=\"linked\">Power Query<\/a> IF statement, which enables users<strong>\u00a0to test conditions and take action accordingly<\/strong>.<\/p>\n<p>In this article, you will be covering the<strong> two methods<\/strong> for incorporating Power Query IF statement in Excel &#8211;<\/p>\n<h4>Download the Excel Workbook below to follow along and understand How to Write Power Query IF Statement in Excel \u2013<\/h4>\n<h4><a class=\"IRPP_minimalist icon-download\" href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement.xlsx\" target=\"_blank\" rel=\"nofollow noopener\"><span class=\"ctaText px-3 text-capitalize\"><strong>download excel workbook<\/strong><\/span><span class=\"postTitle px-3\">Power-Query-IF-Statement.xlsx<\/span><\/a><\/h4>\n<p>Let&#8217;s dive into the practical applications of the Power Query IF statement.<\/p>\n<p>&nbsp;<\/p>\n<h3><strong><span id=\"1\" style=\"color: #ff0000;\">Method 1 &#8211; Using Conditional Column<\/span><\/strong><\/h3>\n<p>In Power Query, you can add a conditional column to apply a condition and determine the corresponding value. Let&#8217;s consider an example where we categorize products as &#8220;Fast Selling&#8221; or &#8220;Slow Selling&#8221; based on the quantity sold.<\/p>\n<p>Suppose you have a<strong> list of products with the quantity sold listed<\/strong> in a data table. If the <strong>quantity sold is greater than 50<\/strong>, the product category will be<strong> fast selling<\/strong> else slow selling. Follow the steps below to add a conditional column in Power Query &#8211;<\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 1:<\/span><\/strong> Highlight the data table and go to <strong>Data<\/strong> and select <strong>From Table\/Range<\/strong>.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-1.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31762\" title=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-1.png\" alt=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" width=\"1222\" height=\"789\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-1.png 1222w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-1-300x194.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-1-1024x661.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-1-768x496.png 768w\" sizes=\"(max-width: 1222px) 100vw, 1222px\" \/><\/a><\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 2:<\/span><\/strong> In the Create Table dialog box, select <strong>OK<\/strong>.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-2.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31763\" title=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-2.png\" alt=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" width=\"835\" height=\"670\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-2.png 835w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-2-300x241.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-2-768x616.png 768w\" sizes=\"(max-width: 835px) 100vw, 835px\" \/><\/a><\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 3:<\/span><\/strong> In the Power Query window, go to <strong>Add Column<\/strong> &gt; <strong>Conditional Column<\/strong>.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-11.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31772\" title=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-11.png\" alt=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" width=\"1314\" height=\"170\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-11.png 1314w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-11-300x39.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-11-1024x132.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-11-768x99.png 768w\" sizes=\"(max-width: 1314px) 100vw, 1314px\" \/><\/a><\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 4:<\/span><\/strong> In the Add Conditional Column dialog box, name the new column &#8220;Product Category.&#8221;<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-12.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31773\" title=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-12.png\" alt=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" width=\"1150\" height=\"476\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-12.png 1150w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-12-300x124.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-12-1024x424.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-12-768x318.png 768w\" sizes=\"(max-width: 1150px) 100vw, 1150px\" \/><\/a><\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 5:<\/span><\/strong> Set the column name to &#8220;Quantity Sold&#8221;<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-13.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31774\" title=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-13.png\" alt=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" width=\"1147\" height=\"480\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-13.png 1147w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-13-300x126.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-13-1024x429.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-13-768x321.png 768w\" sizes=\"(max-width: 1147px) 100vw, 1147px\" \/><\/a><\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 6:<\/span><\/strong> Choose the operator as &#8220;is greater than&#8221;.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-14.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31775\" title=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-14.png\" alt=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" width=\"1159\" height=\"491\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-14.png 1159w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-14-300x127.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-14-1024x434.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-14-768x325.png 768w\" sizes=\"(max-width: 1159px) 100vw, 1159px\" \/><\/a><\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 7:<\/span><\/strong> Enter the <strong>value as 50<\/strong>.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-15.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31776\" title=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-15.png\" alt=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" width=\"1151\" height=\"470\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-15.png 1151w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-15-300x123.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-15-1024x418.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-15-768x314.png 768w\" sizes=\"(max-width: 1151px) 100vw, 1151px\" \/><\/a><\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 8:<\/span><\/strong> Specify the output as &#8220;Fast Selling&#8221;.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-16.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31777\" title=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-16.png\" alt=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" width=\"1153\" height=\"480\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-16.png 1153w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-16-300x125.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-16-1024x426.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-16-768x320.png 768w\" sizes=\"(max-width: 1153px) 100vw, 1153px\" \/><\/a><\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 9:<\/span><\/strong> Enter &#8220;Slow Selling&#8221; as the Else value.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-17.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31778\" title=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-17.png\" alt=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" width=\"1141\" height=\"484\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-17.png 1141w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-17-300x127.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-17-1024x434.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-17-768x326.png 768w\" sizes=\"(max-width: 1141px) 100vw, 1141px\" \/><\/a><\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 10: <\/span><\/strong>Finally, go to <strong>Home<\/strong> and select <strong>Close &amp; Load<\/strong>.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-9.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31770\" title=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-9.png\" alt=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" width=\"1430\" height=\"171\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-9.png 1430w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-9-300x36.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-9-1024x122.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-9-768x92.png 768w\" sizes=\"(max-width: 1430px) 100vw, 1430px\" \/><\/a><\/p>\n<p>This loads the data, now with the new conditional column, back into the Excel workbook.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-10.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31771\" title=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-10.png\" alt=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" width=\"558\" height=\"625\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-10.png 558w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-10-268x300.png 268w\" sizes=\"(max-width: 558px) 100vw, 558px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h3><strong><span id=\"2\" style=\"color: #ff0000;\">Method 2 &#8211; Using Custom Column<\/span><\/strong><\/h3>\n<p>Alternatively, you can write the IF statement in Power Query similarly to how you write an <a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/if-function-in-excel\/\" target=\"_blank\" rel=\"nofollow noopener\"><strong>IF<\/strong><\/a> function in Excel. The <strong>syntax<\/strong> is as follows:<\/p>\n<p><strong>if condition then value1 else value2<\/strong><\/p>\n<p>where,<\/p>\n<ul>\n<li><strong>condition<\/strong> &#8211;\u00a0 represents the logical test<\/li>\n<li><strong>value1<\/strong> &#8211; result if the condition is true<\/li>\n<li><strong>value2<\/strong> &#8211; result if the condition is false<\/li>\n<\/ul>\n<p>Let us look at an example to understand better.<\/p>\n<p>You can use Power Query IF statement to<strong> categorize these products based on the quantity sold<\/strong> using the syntax below &#8211;<\/p>\n<p><strong>= if [Quantity Sold] &gt; 50 then &#8220;Fast Selling&#8221; else &#8220;Slow Selling&#8221;<\/strong><\/p>\n<p>Follow the steps below to achieve this &#8211;<\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 1:<\/span><\/strong> Highlight the data table and go to <strong>Data<\/strong> and select <strong>From Table\/Range<\/strong>.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-1.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31762\" title=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-1.png\" alt=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" width=\"1222\" height=\"789\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-1.png 1222w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-1-300x194.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-1-1024x661.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-1-768x496.png 768w\" sizes=\"(max-width: 1222px) 100vw, 1222px\" \/><\/a><\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 2:<\/span><\/strong> In the Create <a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/how-to-insert-an-excel-table\/\" target=\"_blank\" rel=\"nofollow noopener\"><strong>Table<\/strong> <\/a>dialog box, select <strong>OK<\/strong>.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-2.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31763\" title=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-2.png\" alt=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" width=\"835\" height=\"670\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-2.png 835w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-2-300x241.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-2-768x616.png 768w\" sizes=\"(max-width: 835px) 100vw, 835px\" \/><\/a><\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 3:<\/span><\/strong> In the Power Query window, go to <strong>Add Column<\/strong> &gt; <strong>Custom Column<\/strong>.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-4.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31765\" title=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-4.png\" alt=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" width=\"1315\" height=\"186\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-4.png 1315w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-4-300x42.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-4-1024x145.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-4-768x109.png 768w\" sizes=\"(max-width: 1315px) 100vw, 1315px\" \/><\/a><\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 4:<\/span><\/strong> In the Custom Column dialog box, enter <strong>Product Category as the New column name<\/strong>.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-6.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31767\" title=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-6.png\" alt=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" width=\"873\" height=\"548\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-6.png 873w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-6-300x188.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-6-768x482.png 768w\" sizes=\"(max-width: 873px) 100vw, 873px\" \/><\/a><\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 5: <\/span><\/strong>Enter the following in the Custom column formula &#8211;<\/p>\n<p><strong>=if [Quantity Sold] &gt; 50 then &#8220;Fast Selling&#8221; else &#8220;Slow Selling&#8221;<\/strong><\/p>\n<p>Click <strong>OK<\/strong>.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-7.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31768\" title=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-7.png\" alt=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" width=\"875\" height=\"550\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-7.png 875w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-7-300x189.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-7-768x483.png 768w\" sizes=\"(max-width: 875px) 100vw, 875px\" \/><\/a><\/p>\n<p>The new custom column will be added in the Power Query window.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-8.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31769\" title=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-8.png\" alt=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" width=\"1920\" height=\"781\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-8.png 1920w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-8-300x122.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-8-1024x417.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-8-768x312.png 768w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-8-1536x625.png 1536w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 10: <\/span><\/strong>Go\u00a0to <strong>Home<\/strong> and select <strong>Close &amp; Load<\/strong>.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-9.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31770\" title=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-9.png\" alt=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" width=\"1430\" height=\"171\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-9.png 1430w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-9-300x36.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-9-1024x122.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-9-768x92.png 768w\" sizes=\"(max-width: 1430px) 100vw, 1430px\" \/><\/a><\/p>\n<p>This will load the data with the new custom column into the Excel workbook.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-10.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31771\" title=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-10.png\" alt=\"How to Write Power Query IF Statement in Excel - 2 Easy Examples\" width=\"558\" height=\"625\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-10.png 558w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2023\/10\/Power-Query-IF-Statement-10-268x300.png 268w\" sizes=\"(max-width: 558px) 100vw, 558px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Please note the following &#8211;<\/p>\n<ul>\n<li>Power Query is case-sensitive, so you need to write \u201cif\u201d, \u201cthen\u201d, and \u201celse\u201d in <strong>lowercase<\/strong>.<\/li>\n<li>There&#8217;s <strong>no need for a comma<\/strong> to separate value1 and value2.<\/li>\n<li>You can insert <strong>null<\/strong> if you want a result to be <strong>blank<\/strong>.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3><strong><span style=\"color: #ff0000;\">Conclusion<\/span><\/strong><\/h3>\n<p>In a nutshell, Power Query in Excel is like a power tool for dealing with messy data. We learned two cool ways to use the IF statement &#8211; one by adding a special column based on conditions, and another by creating a custom column with a simple formula. Now, you can impress Excel with your data-handling skills!<\/p>\n<p><a href=\"https:\/\/learn.microsoft.com\/en-us\/powerquery-m\/m-spec-conditionals\" target=\"_blank\" rel=\"nofollow noopener\"><strong>Click here<\/strong><\/a> to learn more about Power Query in Excel.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Power Query is a new add-in introduced in Excel 2013 by Microsoft that accesses, cleans, and transforms all that messy data and displays it in a way that Excel loves and can work with. A particularly powerful feature is the Power Query IF statement, which enables users\u00a0to test conditions and take action accordingly. In this [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":31814,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"cos_headline_score":0,"cos_seo_score":0,"cos_headline_text":"","cos_headline_has_been_analyzed":false,"cos_last_analyzed_headline":[],"om_disable_all_campaigns":false},"categories":[121,120],"tags":[1436,1434,1435],"acf":[],"_links":{"self":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts\/31759"}],"collection":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/comments?post=31759"}],"version-history":[{"count":0,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts\/31759\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/media\/31814"}],"wp:attachment":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/media?parent=31759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/categories?post=31759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/tags?post=31759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}