Hi,
How can I sum up each column based on the criteria inputted? What I've used is this but obviously not the most practical.
=SUMIF(B2:B25,K2,C2:C25)+SUMIF(D2:D25,K2,E2:E25)+SUMIF(F2:F25,K2,G2:G25)+SUMIF(H2:H25,K2,I2:I25)
How can I simplify this?
[TABLE="width: 704"]
<colgroup><col width="64" span="11" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"]Oranges[/TD]
[TD="width: 64, align: right"]39[/TD]
[TD="width: 64"]Pears[/TD]
[TD="width: 64, align: right"]76[/TD]
[TD="width: 64"]Pears[/TD]
[TD="width: 64, align: right"]10[/TD]
[TD="width: 64"]Oranges[/TD]
[TD="width: 64, align: right"]62[/TD]
[TD="width: 64"][/TD]
[TD="width: 64"]Oranges[/TD]
[TD="class: xl63, width: 64, align: right"]1,862[/TD]
[/TR]
[TR]
[TD]Pears[/TD]
[TD="align: right"]48[/TD]
[TD]Apples[/TD]
[TD="align: right"]49[/TD]
[TD]Oranges[/TD]
[TD="align: right"]78[/TD]
[TD]Pears[/TD]
[TD="align: right"]93[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pears[/TD]
[TD="align: right"]50[/TD]
[TD]Apples[/TD]
[TD="align: right"]42[/TD]
[TD]Pears[/TD]
[TD="align: right"]50[/TD]
[TD]Pears[/TD]
[TD="align: right"]26[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD="align: right"]60[/TD]
[TD]Oranges[/TD]
[TD="align: right"]81[/TD]
[TD]Oranges[/TD]
[TD="align: right"]17[/TD]
[TD]Apples[/TD]
[TD="align: right"]77[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD="align: right"]53[/TD]
[TD]Oranges[/TD]
[TD="align: right"]75[/TD]
[TD]Oranges[/TD]
[TD="align: right"]13[/TD]
[TD]Oranges[/TD]
[TD="align: right"]52[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pears[/TD]
[TD="align: right"]75[/TD]
[TD]Pears[/TD]
[TD="align: right"]78[/TD]
[TD]Apples[/TD]
[TD="align: right"]8[/TD]
[TD]Apples[/TD]
[TD="align: right"]13[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pears[/TD]
[TD="align: right"]3[/TD]
[TD]Apples[/TD]
[TD="align: right"]47[/TD]
[TD]Oranges[/TD]
[TD="align: right"]98[/TD]
[TD]Oranges[/TD]
[TD="align: right"]9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD="align: right"]62[/TD]
[TD]Apples[/TD]
[TD="align: right"]33[/TD]
[TD]Oranges[/TD]
[TD="align: right"]14[/TD]
[TD]Oranges[/TD]
[TD="align: right"]20[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD="align: right"]65[/TD]
[TD]Pears[/TD]
[TD="align: right"]49[/TD]
[TD]Oranges[/TD]
[TD="align: right"]42[/TD]
[TD]Oranges[/TD]
[TD="align: right"]51[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD="align: right"]30[/TD]
[TD]Oranges[/TD]
[TD="align: right"]35[/TD]
[TD]Oranges[/TD]
[TD="align: right"]3[/TD]
[TD]Pears[/TD]
[TD="align: right"]26[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD="align: right"]67[/TD]
[TD]Pears[/TD]
[TD="align: right"]40[/TD]
[TD]Oranges[/TD]
[TD="align: right"]40[/TD]
[TD]Apples[/TD]
[TD="align: right"]50[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD="align: right"]52[/TD]
[TD]Apples[/TD]
[TD="align: right"]1[/TD]
[TD]Apples[/TD]
[TD="align: right"]77[/TD]
[TD]Oranges[/TD]
[TD="align: right"]82[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD="align: right"]94[/TD]
[TD]Oranges[/TD]
[TD="align: right"]42[/TD]
[TD]Apples[/TD]
[TD="align: right"]25[/TD]
[TD]Pears[/TD]
[TD="align: right"]15[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pears[/TD]
[TD="align: right"]58[/TD]
[TD]Pears[/TD]
[TD="align: right"]50[/TD]
[TD]Apples[/TD]
[TD="align: right"]89[/TD]
[TD]Oranges[/TD]
[TD="align: right"]8[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD="align: right"]11[/TD]
[TD]Apples[/TD]
[TD="align: right"]65[/TD]
[TD]Pears[/TD]
[TD="align: right"]95[/TD]
[TD]Pears[/TD]
[TD="align: right"]86[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pears[/TD]
[TD="align: right"]33[/TD]
[TD]Pears[/TD]
[TD="align: right"]81[/TD]
[TD]Oranges[/TD]
[TD="align: right"]3[/TD]
[TD]Oranges[/TD]
[TD="align: right"]22[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD="align: right"]26[/TD]
[TD]Pears[/TD]
[TD="align: right"]52[/TD]
[TD]Apples[/TD]
[TD="align: right"]38[/TD]
[TD]Apples[/TD]
[TD="align: right"]88[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD="align: right"]53[/TD]
[TD]Oranges[/TD]
[TD="align: right"]7[/TD]
[TD]Apples[/TD]
[TD="align: right"]60[/TD]
[TD]Pears[/TD]
[TD="align: right"]80[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD="align: right"]91[/TD]
[TD]Pears[/TD]
[TD="align: right"]3[/TD]
[TD]Pears[/TD]
[TD="align: right"]2[/TD]
[TD]Pears[/TD]
[TD="align: right"]71[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD="align: right"]14[/TD]
[TD]Oranges[/TD]
[TD="align: right"]64[/TD]
[TD]Pears[/TD]
[TD="align: right"]20[/TD]
[TD]Apples[/TD]
[TD="align: right"]35[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD="align: right"]99[/TD]
[TD]Pears[/TD]
[TD="align: right"]92[/TD]
[TD]Oranges[/TD]
[TD="align: right"]48[/TD]
[TD]Oranges[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD="align: right"]88[/TD]
[TD]Apples[/TD]
[TD="align: right"]43[/TD]
[TD]Oranges[/TD]
[TD="align: right"]95[/TD]
[TD]Pears[/TD]
[TD="align: right"]9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pears[/TD]
[TD="align: right"]25[/TD]
[TD]Apples[/TD]
[TD="align: right"]16[/TD]
[TD]Oranges[/TD]
[TD="align: right"]89[/TD]
[TD]Pears[/TD]
[TD="align: right"]32[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD="align: right"]62[/TD]
[TD]Pears[/TD]
[TD="align: right"]27[/TD]
[TD]Pears[/TD]
[TD="align: right"]25[/TD]
[TD]Pears[/TD]
[TD="align: right"]84[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
How can I sum up each column based on the criteria inputted? What I've used is this but obviously not the most practical.
=SUMIF(B2:B25,K2,C2:C25)+SUMIF(D2:D25,K2,E2:E25)+SUMIF(F2:F25,K2,G2:G25)+SUMIF(H2:H25,K2,I2:I25)
How can I simplify this?
[TABLE="width: 704"]
<colgroup><col width="64" span="11" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"]Oranges[/TD]
[TD="width: 64, align: right"]39[/TD]
[TD="width: 64"]Pears[/TD]
[TD="width: 64, align: right"]76[/TD]
[TD="width: 64"]Pears[/TD]
[TD="width: 64, align: right"]10[/TD]
[TD="width: 64"]Oranges[/TD]
[TD="width: 64, align: right"]62[/TD]
[TD="width: 64"][/TD]
[TD="width: 64"]Oranges[/TD]
[TD="class: xl63, width: 64, align: right"]1,862[/TD]
[/TR]
[TR]
[TD]Pears[/TD]
[TD="align: right"]48[/TD]
[TD]Apples[/TD]
[TD="align: right"]49[/TD]
[TD]Oranges[/TD]
[TD="align: right"]78[/TD]
[TD]Pears[/TD]
[TD="align: right"]93[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pears[/TD]
[TD="align: right"]50[/TD]
[TD]Apples[/TD]
[TD="align: right"]42[/TD]
[TD]Pears[/TD]
[TD="align: right"]50[/TD]
[TD]Pears[/TD]
[TD="align: right"]26[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD="align: right"]60[/TD]
[TD]Oranges[/TD]
[TD="align: right"]81[/TD]
[TD]Oranges[/TD]
[TD="align: right"]17[/TD]
[TD]Apples[/TD]
[TD="align: right"]77[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD="align: right"]53[/TD]
[TD]Oranges[/TD]
[TD="align: right"]75[/TD]
[TD]Oranges[/TD]
[TD="align: right"]13[/TD]
[TD]Oranges[/TD]
[TD="align: right"]52[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pears[/TD]
[TD="align: right"]75[/TD]
[TD]Pears[/TD]
[TD="align: right"]78[/TD]
[TD]Apples[/TD]
[TD="align: right"]8[/TD]
[TD]Apples[/TD]
[TD="align: right"]13[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pears[/TD]
[TD="align: right"]3[/TD]
[TD]Apples[/TD]
[TD="align: right"]47[/TD]
[TD]Oranges[/TD]
[TD="align: right"]98[/TD]
[TD]Oranges[/TD]
[TD="align: right"]9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD="align: right"]62[/TD]
[TD]Apples[/TD]
[TD="align: right"]33[/TD]
[TD]Oranges[/TD]
[TD="align: right"]14[/TD]
[TD]Oranges[/TD]
[TD="align: right"]20[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD="align: right"]65[/TD]
[TD]Pears[/TD]
[TD="align: right"]49[/TD]
[TD]Oranges[/TD]
[TD="align: right"]42[/TD]
[TD]Oranges[/TD]
[TD="align: right"]51[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD="align: right"]30[/TD]
[TD]Oranges[/TD]
[TD="align: right"]35[/TD]
[TD]Oranges[/TD]
[TD="align: right"]3[/TD]
[TD]Pears[/TD]
[TD="align: right"]26[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD="align: right"]67[/TD]
[TD]Pears[/TD]
[TD="align: right"]40[/TD]
[TD]Oranges[/TD]
[TD="align: right"]40[/TD]
[TD]Apples[/TD]
[TD="align: right"]50[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD="align: right"]52[/TD]
[TD]Apples[/TD]
[TD="align: right"]1[/TD]
[TD]Apples[/TD]
[TD="align: right"]77[/TD]
[TD]Oranges[/TD]
[TD="align: right"]82[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD="align: right"]94[/TD]
[TD]Oranges[/TD]
[TD="align: right"]42[/TD]
[TD]Apples[/TD]
[TD="align: right"]25[/TD]
[TD]Pears[/TD]
[TD="align: right"]15[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pears[/TD]
[TD="align: right"]58[/TD]
[TD]Pears[/TD]
[TD="align: right"]50[/TD]
[TD]Apples[/TD]
[TD="align: right"]89[/TD]
[TD]Oranges[/TD]
[TD="align: right"]8[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD="align: right"]11[/TD]
[TD]Apples[/TD]
[TD="align: right"]65[/TD]
[TD]Pears[/TD]
[TD="align: right"]95[/TD]
[TD]Pears[/TD]
[TD="align: right"]86[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pears[/TD]
[TD="align: right"]33[/TD]
[TD]Pears[/TD]
[TD="align: right"]81[/TD]
[TD]Oranges[/TD]
[TD="align: right"]3[/TD]
[TD]Oranges[/TD]
[TD="align: right"]22[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD="align: right"]26[/TD]
[TD]Pears[/TD]
[TD="align: right"]52[/TD]
[TD]Apples[/TD]
[TD="align: right"]38[/TD]
[TD]Apples[/TD]
[TD="align: right"]88[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD="align: right"]53[/TD]
[TD]Oranges[/TD]
[TD="align: right"]7[/TD]
[TD]Apples[/TD]
[TD="align: right"]60[/TD]
[TD]Pears[/TD]
[TD="align: right"]80[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD="align: right"]91[/TD]
[TD]Pears[/TD]
[TD="align: right"]3[/TD]
[TD]Pears[/TD]
[TD="align: right"]2[/TD]
[TD]Pears[/TD]
[TD="align: right"]71[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD="align: right"]14[/TD]
[TD]Oranges[/TD]
[TD="align: right"]64[/TD]
[TD]Pears[/TD]
[TD="align: right"]20[/TD]
[TD]Apples[/TD]
[TD="align: right"]35[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD="align: right"]99[/TD]
[TD]Pears[/TD]
[TD="align: right"]92[/TD]
[TD]Oranges[/TD]
[TD="align: right"]48[/TD]
[TD]Oranges[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD="align: right"]88[/TD]
[TD]Apples[/TD]
[TD="align: right"]43[/TD]
[TD]Oranges[/TD]
[TD="align: right"]95[/TD]
[TD]Pears[/TD]
[TD="align: right"]9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pears[/TD]
[TD="align: right"]25[/TD]
[TD]Apples[/TD]
[TD="align: right"]16[/TD]
[TD]Oranges[/TD]
[TD="align: right"]89[/TD]
[TD]Pears[/TD]
[TD="align: right"]32[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD="align: right"]62[/TD]
[TD]Pears[/TD]
[TD="align: right"]27[/TD]
[TD]Pears[/TD]
[TD="align: right"]25[/TD]
[TD]Pears[/TD]
[TD="align: right"]84[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]