Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Excel - IF formula with range of cells

3 views
Skip to first unread message

Chris

unread,
Jan 7, 2010, 6:45:01 PM1/7/10
to
I am trying to create a formula that if a range of cells contains a specific
value AND a range of cells in the next column contains a specific value, then
the corresponding cells in the third column will be summed. What I have is
below. It recognizes the formula as long as all the cells in the range of the
first two columns contain the respective specific values. Can anyone suggest
a corrected formula, so the values in the cell ranges can vary? Thanks!

=(IF((AND(A2:A500="Value 1",B2:B500="Value 2")),SUM(C2:C500)))

Mike H

unread,
Jan 7, 2010, 7:01:03 PM1/7/10
to
Chris,

Try this

=SUMPRODUCT((A2:A500="Value1")*(B2:B500="Value2")*(C2:C500))

Mike

ryguy7272

unread,
Jan 7, 2010, 7:24:10 PM1/7/10
to
Here's another way:
=SUMPRODUCT(--(A1:A13="vijayawada1"),--(B1:B13="vijayawada2"),C1:C13)

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.

0 new messages