SUMIFS Units and skip such values

Salamullah

Board Regular
Joined
Mar 28, 2011
Messages
215
Units
Amount
Month
100
2300
Jan
100
0.10
Jan
200
1000
Feb
-200
-1000
Feb
300
2000
Jan
300
-0.08
Jan

<tbody>
</tbody>

I want to apply formula in the column A Units and wanted to skip units if Values in column B is between -0.5 to 0.5, please help based on the above example the answer of column A should be 400 in Cell E2 whereas D2 contained Jan. with SUMIFS formula
 

kweaver

Well-known Member
Joined
May 8, 2018
Messages
839
Office Version
365, 2010
This is 400, but do you really mean SKIP within that range? If so, it wouldn't be 400 would it?

Code:
=SUMIFS(A2:A7,B2:B7,">="&-0.5,B2:B7,"<="&0.5)
 
Last edited:

kweaver

Well-known Member
Joined
May 8, 2018
Messages
839
Office Version
365, 2010
Maybe you mean this:

Code:
=SUMPRODUCT((A2:A7)*((B2:B7<=-0.5)+(B2:B7>=0.5)))
which is 400 which is the sum of all the values in the A column that are <=-0.5 OR >=0.5
 
Last edited:

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
33,619
Office Version
365
Platform
Windows
Or is this what you want

<b></b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>A</th><th>B</th><th>C</th><th>D</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style=";">Units</td><td style=";">Amount</td><td style=";">Month</td><td style=";"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style="text-align: right;;">100</td><td style="text-align: right;;">2300</td><td style=";">Jan</td><td style=";">400</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style="text-align: right;;">100</td><td style="text-align: right;;">0.1</td><td style=";">Jan</td><td style=";"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style="text-align: right;;">200</td><td style="text-align: right;;">1000</td><td style=";">Feb</td><td style=";"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">5</td><td style="text-align: right;;">-200</td><td style="text-align: right;;">-1000</td><td style=";">Feb</td><td style=";"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">6</td><td style="text-align: right;;">300</td><td style="text-align: right;;">2000</td><td style=";">Jan</td><td style=";"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">7</td><td style="text-align: right;;">300</td><td style="text-align: right;;">-0.08</td><td style=";">Jan</td><td style=";"></td></tr></tbody></table><p style="width:5.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Week 28</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">D2</th><td style="text-align:left">=SUMPRODUCT(<font color="Blue">(<font color="Red">C2:C7=C2</font>)*(<font color="Red">(<font color="Green">B2:B7<=-0.5</font>)+(<font color="Green">B2:B7>=0.5</font>)</font>)*(<font color="Red">A2:A7</font>)</font>)</td></tr></tbody></table></td></tr></table><br />
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
33,619
Office Version
365
Platform
Windows
Glad we could help & thanks for the feedback.

For reference, which formula is correct?
 

Forum statistics

Threads
1,085,245
Messages
5,382,547
Members
401,791
Latest member
BJSinger7623

Some videos you may like

This Week's Hot Topics

Top