0

I'm trying to create a formula so that if in cell E2 it says "Market", "Limit", or "Stop" it adds the numbers in cells L2 and M2.

=SUMIF(E2, "Market" "Limit" "Stop", L2+M2)

These expressions are part of a data validation list, I'm not sure if that effects the result or not. I've tried the help files, Google searches and formula wizard. I just can't figure this out.

1 Answer 1

3

If looks like you are applying SUMIF where an IF might work as from the references in your example they are all on a single row. As such you could use:

=IF(OR(E2="Market",E2="Limit",E2="Stop"),L2+M2,0)

This combines the IF statement with the OR statement so that we can make multiple comparisons.

addendum:

=IF(OR(E2="Market",E2="Limit",E2="Stop"),L2+M2,IF(E2="Sell",M2,0))
2
  • Thanks! I found a logical error in my sheet, though (not your formula), do you know how I can expand on this to make it include that if it says "sell" in E2 it just displays the value of M2?
    – Alex
    May 10, 2014 at 19:19
  • @Alex Just make another IF in the else part of the formula. You should know the syntax now.
    – Jerry
    May 10, 2014 at 19:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .