=SUMIF(F5:F500,"TR"+"AU",G5:G500)

data808

Active Member
Joined
Dec 3, 2010
Messages
353
Office Version
  1. 2019
Platform
  1. Windows
I have a drop down list in column F starting from cell F5 for the user to select from a few values. The user then will enter the number amount into column G starting from the G5 cell. Finally I have a totals cell that will sum up all the column G values if the user selects "MP" value from the drop down list in column F. Here is the formula for that:

=SUMIF(F5:F500,"MP",G5:G500)

It works fine. However now I want another totals cell to add up two types from the drop down list. Values "TR" and "AU" but I'm having issues with the formula. I have tried these with no luck:

=SUMIF(F5:F500,"TR"+"AU",G5:G500)
=SUMIF(F5:F500,"TR+AU",G5:G500)
=SUMIF(F5:F500,"TR" OR "AU",G5:G500)
=SUMIF(F5:F500,"TR"&"AU",G5:G500)

Please help. Thanks.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try one of these.
Excel Formula:
=SUMIF(F5:F500,"TR",G5:G500)+SUMIF(F5:F500,"AU",G5:G500)
Excel Formula:
=SUMPRODUCT(--ISNUMBER(MATCH(F5:F500,{"TR","AU"},0)),G5:G500)
 
Upvote 0
Solution
Try one of these.
Excel Formula:
=SUMIF(F5:F500,"TR",G5:G500)+SUMIF(F5:F500,"AU",G5:G500)
Excel Formula:
=SUMPRODUCT(--ISNUMBER(MATCH(F5:F500,{"TR","AU"},0)),G5:G500)
Worked like a charm. Thank you very much!
 
Upvote 0
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,215,425
Messages
6,124,825
Members
449,190
Latest member
rscraig11

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