[{"data":1,"prerenderedAt":188},["ShallowReactive",2],{"blog-\u002Fblog\u002F01-sumproduct-vs-sumifs":3,"blog-surround-\u002Fblog\u002F01-sumproduct-vs-sumifs":186,"blog-related-\u002Fblog\u002F01-sumproduct-vs-sumifs":187},{"id":4,"title":5,"audience":6,"body":7,"cluster":6,"date":162,"description":163,"draft":164,"extension":165,"factCheckedAt":6,"faq":166,"featured":164,"language":55,"meta":173,"navigation":174,"order":6,"originalAsset":6,"path":175,"pillar":6,"primaryKeyword":176,"relatedProject":6,"releaseScope":6,"reviewCycle":177,"reviewStatus":178,"reviewedBy":179,"searchIntent":6,"seo":180,"sources":6,"stem":181,"tags":182,"type":14,"updated":6,"__hash__":185},"blog\u002Fblog\u002F01-sumproduct-vs-sumifs.md","SUMPRODUCT instead of SUMIFS for dynamic conditions",null,{"type":8,"value":9,"toc":157},"minimark",[10,26,31,49,66,73,77,106,123,133,137,153],[11,12,13,17,18,21,22,25],"p",{},[14,15,16],"code",{},"SUMIFS"," is great until the column you're summing is decided at runtime. Then you start writing nested ",[14,19,20],{},"INDIRECT"," formulas and everything turns to mud. ",[14,23,24],{},"SUMPRODUCT"," handles this in one expression.",[27,28,30],"h2",{"id":29},"the-setup","The setup",[11,32,33,34,37,38,37,41,44,45,48],{},"You have a transaction table. A user picks a measure (",[14,35,36],{},"Amount",", ",[14,39,40],{},"Quantity",[14,42,43],{},"Tax",") from a dropdown, and you need to sum that column where ",[14,46,47],{},"Region = \"EMEA\"",".",[50,51,57],"pre",{"className":52,"code":53,"filename":54,"language":55,"meta":56,"style":56},"language-excel shiki shiki-themes github-light github-dark","=SUMIFS(C2:C1000, B2:B1000, \"EMEA\")\n","SUMIFS — breaks when column changes","excel","",[14,58,59],{"__ignoreMap":56},[60,61,64],"span",{"class":62,"line":63},"line",1,[60,65,53],{},[11,67,68,69,72],{},"The column ",[14,70,71],{},"C2:C1000"," is hard-coded. Change the dropdown, change the formula.",[27,74,76],{"id":75},"the-fix","The fix",[50,78,81],{"className":52,"code":79,"filename":80,"language":55,"meta":56,"style":56},"=SUMPRODUCT(\n  (B2:B1000 = \"EMEA\") *\n  INDEX(A2:E1000, 0, MATCH(G1, A1:E1, 0))\n)\n","SUMPRODUCT — column resolved dynamically",[14,82,83,88,94,100],{"__ignoreMap":56},[60,84,85],{"class":62,"line":63},[60,86,87],{},"=SUMPRODUCT(\n",[60,89,91],{"class":62,"line":90},2,[60,92,93],{},"  (B2:B1000 = \"EMEA\") *\n",[60,95,97],{"class":62,"line":96},3,[60,98,99],{},"  INDEX(A2:E1000, 0, MATCH(G1, A1:E1, 0))\n",[60,101,103],{"class":62,"line":102},4,[60,104,105],{},")\n",[11,107,108,111,112,115,116,119,120,122],{},[14,109,110],{},"G1"," holds the dropdown value. ",[14,113,114],{},"MATCH"," finds the right column index. ",[14,117,118],{},"INDEX(..., 0, n)"," returns the whole column as an array. ",[14,121,24],{}," multiplies the boolean mask by the values.",[124,125,127],"callout",{"type":126},"tip",[11,128,129,130,132],{},"This pattern also lets you sum across multiple sheets without ",[14,131,20],{}," — just multiply more boolean arrays together.",[27,134,136],{"id":135},"when-not-to-use-it","When not to use it",[11,138,139,140,142,143,145,146,149,150,152],{},"On tables over 100k rows, ",[14,141,24],{}," is materially slower than ",[14,144,16],{}," because it can't push down the filter. For those cases, build a small wrapper that picks the column with ",[14,147,148],{},"CHOOSE"," and use ",[14,151,16],{}," inside.",[154,155,156],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":56,"searchDepth":90,"depth":90,"links":158},[159,160,161],{"id":29,"depth":90,"text":30},{"id":75,"depth":90,"text":76},{"id":135,"depth":90,"text":136},"2026-05-13","When your criteria column changes on the fly, SUMPRODUCT is the cleaner pattern.",false,"md",[167,170],{"question":168,"answer":169},"When should I use SUMPRODUCT instead of SUMIFS?","Use SUMPRODUCT when the column you're summing is chosen at runtime (for example from a dropdown). SUMIFS hard-codes the sum range, so a changing target column forces nested INDIRECT formulas; SUMPRODUCT resolves the column dynamically with INDEX and MATCH in a single expression.",{"question":171,"answer":172},"Is SUMPRODUCT slower than SUMIFS?","Yes. On tables over about 100k rows SUMPRODUCT is materially slower because it can't push the filter down. For those cases, pick the column with CHOOSE and use SUMIFS inside.",{},true,"\u002Fblog\u002F01-sumproduct-vs-sumifs","SUMPRODUCT vs SUMIFS","annual","unreviewed","Tan Gravam",{"title":5,"description":163},"blog\u002F01-sumproduct-vs-sumifs",[55,183,184],"formulas","finance","DLhFrhnsF6AAvFD9_X5UG8x9ZHYJNWGaDPTMyVIIro8",[6,6],[],1785182339100]