{"id":31427,"date":"2021-02-15T18:47:14","date_gmt":"2021-02-15T17:47:14","guid":{"rendered":"https:\/\/blog.sheetgo.com\/?p=31427"},"modified":"2021-02-15T18:47:14","modified_gmt":"2021-02-15T17:47:14","slug":"sumproduct-excel","status":"publish","type":"post","link":"https:\/\/www.sheetgo.com\/es\/blog\/excel-functions\/sumproduct-excel\/","title":{"rendered":"C\u00f3mo utilizar la funci\u00f3n SUMPRODUCT de Excel"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; module_class=&#8221;sheetgo-post&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_row _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>You might think the <a href=\"https:\/\/support.microsoft.com\/en-us\/office\/sumproduct-function-16753e75-9f68-4874-94ac-4d2145a2fd2e\" target=\"_blank\" rel=\"noopener noreferrer\">SUMPRODUCT Excel function<\/a> is pretty boring at first glance, but the function is actually extremely useful and versatile. While its main purpose is to multiply and add up data in arrays, you can also use it for a wide range of more complicated applications. With that being said, I\u2019ll dive right into the details of this function.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>Syntax<\/h3>\n<p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.16&#8243; border_width_left=&#8221;4px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]=SUMPRODUCT(array1, [array2], &#8230;)[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<ul>\n<li><b>array1<\/b> is the first array that you want to multiply with the other arrays and then add the results<\/li>\n<li><b>array2<\/b> and all other arrays onward are optional inputs. The function will multiply the components of all the arrays and then sum up the results<\/li>\n<\/ul>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>How to use SUMPRODUCT in Excel<\/h3>\n<p>I\u2019ll start off by showing a basic example of the SUMPRODUCT Excel function. Like I mentioned before, the function is primarily used to multiply arrays and sum the results.<\/p>\n<p>Take a look at the example below. I have some sales data from a fruit stand.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]To find the total revenue for the day, I need to multiply the price and the quantity for each item. Once I do that, I can add up the results, which give me the total revenue.<\/p>\n<p>I did this in column F, but you can see that this method requires a new column and a bunch of individual calculations. The SUMPRODUCT function is a much quicker way to solve this!<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/02\/1.-Sumproduct-revenue-example.png&#8221; alt=&#8221;sumproduct excel 1&#8243; title_text=&#8221;1. Sumproduct revenue example&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.23.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>By typing <b>=SUMPRODUCT(B2:B7,C2:C7)<\/b> I instruct the function to multiply each quantity with the corresponding price, and add up the total. This gives me the revenue all in one cell!<\/p>\n<p>I added the longer calculations in column F so you can see that the result is the same \u2013 SUMPRODUCT is just much faster.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h4>Using SUMPRODUCT to count<\/h4>\n<p>When you input multiple arrays, SUMPRODUCT will multiply and sum them. But what if you only input one array? As you saw in the syntax, only the first array is required for the function to work.<\/p>\n<p>When you only input one array, the function will simply add up that array. You can see that in the screenshot below, where I use the function <b>=SUMPRODUCT(B2:B7)<\/b> to add up the total quantity of items sold.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/02\/2.-Sumproduct-quantity-example.png&#8221; alt=&#8221;sumproduct excel 2&#8243; title_text=&#8221;2. Sumproduct quantity example&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.23.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>In this case, SUMPRODUCT works just like the SUM function!<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h4>Combining with other functions<\/h4>\n<p>One of the benefits of the SUMPRODUCT function is that you can combine it with other functions.<\/p>\n<p>In the example below, I combine it with the LEN function to find the total number of characters with the formula <b>=SUMPRODUCT(LEN(A2:A7))<\/b>.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/02\/3.-Sumproduct-characters-example.png&#8221; alt=&#8221;sumproduct excel 3&#8243; title_text=&#8221;3. Sumproduct characters example&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.23.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h4>Other operators<\/h4>\n<p>Based on its name, you may think the SUMPRODUCT function can only do multiplication between arrays. However, the function can also do arithmetic operations (*, \/, +, -) between arrays. The constant theme is that it always performs the operation across the arrays, and then adds up the total.<\/p>\n<p>Take a look at the example below. I use the SUMPRODUCT function to add up the Price and Tax columns, then multiply by the quantity. I do this with the formula <b>=SUMPRODUCT(B2:B7*(C2:C7+D2:D7))<\/b>.\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/02\/4.-Sumproduct-with-addition.png&#8221; alt=&#8221;sumproduct excel 4&#8243; title_text=&#8221;4. Sumproduct with addition&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.23.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>Tip: to specify which operation you want to perform, just add the sign between the arrays instead of using a comma. It\u2019s also a good idea to use brackets to make sure it does the operations in the desired order.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h4>Count with text<\/h4>\n<p>I\u2019ve used SUMPRODUCT with arrays of numbers, but now I\u2019ll demonstrate how you can use it with text.<\/p>\n<p>In this example, I use the Item column as my array, but I also specify that I only want cells with the text string \u201cBanana\u201d (I added another row of bananas just for this example).<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/02\/5.-Sumproduct-count-text.png&#8221; alt=&#8221;sumproduct excel 5&#8243; title_text=&#8221;5. Sumproduct count text&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.23.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>You\u2019ll notice something weird about the formula used here, <b>=SUMPRODUCT(&#8211;(A2:A8=&#8221;Banana&#8221;))<\/b>. It has two negative signs (&#8211;) before the brackets. Don\u2019t get too hung up on this \u2013 it\u2019s just what the formula needs to compute the results I want.<\/p>\n<p>When SUMPRODUCT evaluates the expression A2:A8=\u201dBanana\u201d it goes down the column and assigns a TRUE or FALSE to each cell. To sum these, I need to convert them from TRUE\/FALSE to a number.<\/p>\n<p>The \u201c&#8211;\u201c is like multiplying by -1 twice: once to convert the TRUE\/FALSE into a number, and another time to cancel out the negative. So TRUE becomes 1, and FALSE becomes 0. The function then adds these up, and correctly indicates that there are 2 Banana entries.<\/p>\n<p>Note that you could achieve the same effect by using 1* instead of &#8212; (i.e. multiply by 1 instead of by -1 twice), but it\u2019s a bit quicker to type the two dashes.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h4>SUMPRODUCT with text string and multiple arrays<\/h4>\n<p>Now I\u2019ll combine some of the previous examples. Here, I want the total revenue from selling bananas. I have to use 3 different arrays here.<\/p>\n<p>The first looks at the text strings in the Item column and tells the function to only consider bananas (by assigning them a 1 and the rest a 0). Then it multiplies this by the price and quantity, and adds up the result to give the total revenue from bananas.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/02\/6.-Sumproduct-count-and-multiply.png&#8221; alt=&#8221;sumproduct excel 6&#8243; title_text=&#8221;6. Sumproduct count and multiply&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.23.1&#8243; _module_preset=&#8221;default&#8221; hover_enabled=&#8221;0&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221; sticky_enabled=&#8221;0&#8243;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>The formula here is <b>=SUMPRODUCT((A2:A8=&#8221;Banana&#8221;)*B2:B8*C2:C8)<\/b>. Note that unlike the last example, I don\u2019t need a &#8212; before the first array. That\u2019s because the TRUE\/FALSE generated by A2:A8=\u201dBanana\u201d is converted to a number when multiplied with the other arrays. So I only needed that trick when it was for just one array!<\/p>\n<p>This example really demonstrates the power of the SUMPRODUCT function. It performs the operations that I want on each entry in my data, and also selectively filters this to give only the results from the items I want to include. All from one formula!<\/p>\n<p>I hope that you now see the utility of the SUMPRODUCT function, and how to use it to perform complex calculations with one simple formula!<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You might think the SUMPRODUCT Excel function is pretty boring at first glance, but the function is actually extremely useful and versatile. While its main purpose is to multiply and add up data in arrays, you can also use it for a wide range of more complicated applications. With that being said, I\u2019ll dive right [&hellip;]<\/p>\n","protected":false},"author":40,"featured_media":31429,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[65],"tags":[39,48,28],"class_list":["post-31427","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-excel-functions","tag-connections-t","tag-excel","tag-spreadsheets"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/posts\/31427","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/comments?post=31427"}],"version-history":[{"count":0,"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/posts\/31427\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/media\/31429"}],"wp:attachment":[{"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/media?parent=31427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/categories?post=31427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/tags?post=31427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}