Sumifs with mod

Ms_Black

New Member
Joined
Dec 14, 2017
Messages
2
Hi,

I'm an Excel newbie and in a bit of a pickle.

I'm trying to find the sum of a range of cells (A1:C12) for numbers between 20 to 80, but only ones that are even numbers.

I'd normally do this with a SUMIFS function easily, but I have no idea how to narrow it down to just the even numbers. I'd wager with a MOD function, but I don't know how to *ahem* formulate my formula ;)

Any tips?

Thanks in advance!
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hi,

Try this:

=SUMPRODUCT(A1:C12,--(A1:C12>=20),--(A1:C12<=80),--(MOD(A1:C12,2)=0))

Thank you so much! This worked wonderfully.

Follow-up question, will this still work if I use it on a range where some cells have text in them? I have certain sheets where the data is a tad jumbled, and I'd only like to sum the cells with numbers in them. Though I don't know if adding an IF clause would complicate it too much, perhaps I'd be better off trying my luck with VBA - Excel sure is fascinating!
 
Upvote 0
Thank you so much! This worked wonderfully.

Follow-up question, will this still work if I use it on a range where some cells have text in them? I have certain sheets where the data is a tad jumbled, and I'd only like to sum the cells with numbers in them. Though I don't know if adding an IF clause would complicate it too much, perhaps I'd be better off trying my luck with VBA - Excel sure is fascinating!

Control+shift+enter, not just enter:

=SUM(IF(ISNUMBER(A1:C12),IF(A1:C12>=20,IF(A1:C12<=80,IF(MOD(A1:C12,2)=0,A1:C12)))))
 
Upvote 0

Forum statistics

Threads
1,215,352
Messages
6,124,455
Members
449,161
Latest member
NHOJ

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top