SUMIF and AND/OR/NOT
E1 = orange
F1 = west
G1 = east
=SUMPRODUCT(--(A1:A4=E1),--(ISNUMBER(MATCH(B1:B4,F1:G1,0))),C1:C4)
Result = 13
--
Biff
Microsoft Excel MVP
"JenniferCHW" wrote in message
...
I tried both responses and can't seem to get this to work. Let me be a bit
more specific with a short example.
Col A Col B Col C
Apple West 5
Orange South 7
Orange East 9
Orange West 4
I am looking for oranges in the west or east only. The answer is 13.
"Pete_UK" wrote:
Not sure if Y and Z are numbers or text - I'll assume numbers, but if
they are text you will need to put quotes around them. Try this:
=SUMPRODUCT((A1:A100="XXXX")*(B1:B100={Y,Z}),(C1:C 100))
Adjust the ranges to suit your data, but you can't use full-column
references if you are using Excel 2003 or earlier.
No need to model column B NOT being e, f, or g - these are excluded
anyway if B is Y or Z.
Hope this helps.
Pete
On Feb 4, 12:28 am, JenniferCHW
wrote:
I am looking to add an AND, OR, or NOT to my formula or a combination
of these
Right now I have
Col A Col b Col C
sumif(column A, "XXXX", column c) (column A meets X criteria then
sum
col. c)
I want the formula to be if column a meets x criteria and the value in
column b is either Y or Z but not e, f, g then sum col c.
If tried a bunch of different options with AND and OR but can't seem to
put
it together in the right order.
Can you provide some guidance?
Thanks.
|