Solved

EXCEL SUM with multiple criteria for cells range

Posted on 2012-03-28
2
404 Views
Last Modified: 2012-03-28
Hello!
I need to insert a SUM formula with multiple criteria for a cell range.
Because there are multiple criteria, I cannot use SUMIF
The criteria are for text cells.
I tried this formula: =SUM(IF((K18="Y")+(K18=""),H18,0))
And it works for a single record.
But If I try to use a range of cell, such as:  =SUM(IF((K18:K20="Y")+(K18:K20=""),H18:20,0))
The formula does not work.  I have either wrong data type error or it does not work at all, just displays the formula.

My real formula is more complicated, but I just want to make sure the formula works.
The formula I used above is pretty much meaningless, the idea is to have a sum of cells in the column H if cells in column K are contain values of Y or blank.
I have Excel 2010, I use Ctrl/Shift/Enter before entering the formula.

Could you please suggest how to do it?
0
Comment
Question by:pavelmed
2 Comments
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
Comment Utility
Your formula should work if "array entered" (and corrected with added "H"), i.e. use

=SUM(IF((K18:K20="Y")+(K18:K20=""),H18:H20,0))

select formula by pressing F2 key then hold down CTRL and SHIFT keys while pressing ENTER. If done correctly curly braces like { and } will appear around the formula

...or you can use a "non-array" version with SUMPRODUCT like this

=SUMPRODUCT((K18:K20="Y")+(K18:K20=""),H18:H20)

or SUMIF like this

=SUM(SUMIF(K18:K20,{"Y",""},H18:H20))

regards, barry
0
 

Author Comment

by:pavelmed
Comment Utility
Thank you Barry!
I missed "H" only in a code typed in the question description, if the formula it was correct.
It did not work for me but it started to work when I used the order of entering as you described.  But I like the SUMPRODUCT version even more.  I modified it to use my more complex logic, and it still works.
Thank you VERY MUCH!!!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now