help with function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

=SUMIF(Reason,(OR("B Scale",B Scale Night)),M20:M33)

I am trying to sum cells in column M20:M33 if the named cells "Reason"
contain the words "B Scale" or "B Scale Night"

What am I doing wrong?
 
A good way to understand why a formla does not return expected result is to
select part of it and press F9, which then replaces the formula by its
result. In your case, if you select the OR(...) part, you see that Excel does
not like it very much. May be it is because of the missing quotes around the
second argument? No, still no luck.

In fact OR function only works with numbers, so in your case you should
proceed differently and add two SUMIF:
=SUMIF(Reason,"B Scale",M20:M33) + SUMIF(Reason,"B Scale Night",M20:M33)
 
Try one of these:

The 2-part method
=SUMIF(Reasons,"b scale",M20:M33)+SUMIF(Reasons,"b scale night",M20:M33)

The combined 2-part method
=SUM(SUMIF(Reasons,{"b scale","b scale night"},M20:M33))

If you need to sum any cell beginning with "b scale"
=SUMIF(Reasons,"b scale*",M20:M33)

Does that help?
(Post back if you have more questions)
***********
Regards,
Ron

XL2003, WinXP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top