MrExcel Consulting
Your One Stop for Excel Tips & Solutions

CountIf or SumIf in Excel with Two Conditions

July 05, 2002 - by Bill Jelen

Kári asks:

I have a formula where I have to put in a criteria. The criteria is, that the formula has to gather numbers that are bigger than 0,5 (>0,5), but not bigger than 2 (<2). But how do I do that? I have tried: ">0,5"&"<2" and a lot of other combinations, but nothing works.

Kári: For a SUMIF or COUNTIF formula with 2 conditions, you need to use an array formula.

I wrote a related article a few years ago, a better version of the formula has come to light. It discusses using this formula for a CountIf with 2 conditions:


You can use boolean logic instead to write this formula for CountIf


or this formula for SumIf:


Remember, you must hold down the Ctrl and Shift keys then hit enter to enter these CSE or Array formulas.