SUMIF Formula Question

amxtomzo

Active Member
Joined
Nov 7, 2009
Messages
312
I would like to shorten this formula and I keep doing somthing dumb. If someone has a moment could you please show me the light. I'll just bet I can use something different also.

Thank you very much for your help I do appreciate it

Thomas

=SUMIF(B2:B18, "SC",A2:A18)+SUMIF(B2:B18, "UNIVSTY",A2:A18)+SUMIF(B2:B18,"NIE",A2:A18)+SUMIF(B2:B18,"DEALER",A2:A18)
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Hi

Perhaps:

=SUM(SUMIF(B2:B18,{"SC","UNIVSTY","NIE","DEALER"},A2:A18))

or

=SUMPRODUCT(ISNUMBER(MATCH(B2:B18,{"SC","UNIVSTY","NIE","DEALER"},0))+0,A2:A18)
 
Upvote 0
Hi there,

You could list your criteria to sum in a column and do a sumif formula againt them. If the criteria is sitting in Column D then formula looks lik this:

SC =sumif(B2:B18,D2,A2:A18)
UNIVSTY =sumif(B2:B18,D3,A2:A18)
NIE =sumif(B2:B18,D4,A2:A18)
DEALER =sumif(B2:B18,D5,A2:A18)
 
Upvote 0
I would like to shorten this formula and I keep doing somthing dumb. If someone has a moment could you please show me the light. I'll just bet I can use something different also.

Thank you very much for your help I do appreciate it

Thomas

=SUMIF(B2:B18, "SC",A2:A18)+SUMIF(B2:B18, "UNIVSTY",A2:A18)+SUMIF(B2:B18,"NIE",A2:A18)+SUMIF(B2:B18,"DEALER",A2:A18)
You're better off if you use cells to hold the criteria:
  • D2 = SC
  • D3 = UNIVSTY
  • D4 = NIE
  • D5 = DEALER
Then:

=SUMPRODUCT(--(ISNUMBER(MATCH(B2:B18,D2:D5,0))),A2:A18)
 
Upvote 0
Richard, dblinn, T.Valko

Thanks so much all are great and I will figure which one works best with our code and forms.

Thanks again, this is a big help to me.

Thomas
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,544
Members
452,925
Latest member
duyvmex

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top