=SUMPRODUCT formula with three criteria help

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,577
Office Version
  1. 365
Platform
  1. Windows
Hi all

I would like a formula that will check thru range B4:B250 of the 'schedule' sheet for a match to the word "BELL", then count the occasions "M" and "M1" appear thru range C4:C250

I have a SUMPRODUCT formula that works for one of the criteria but unsure how to get it to count both 'M' and 'M1'

Code:
=SUMPRODUCT((Schedule!B4:B250="BELL")*(Schedule!C4:C250="M"))

any help appreciated
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,577
Office Version
  1. 365
Platform
  1. Windows
After some playing around (and extensive www searching) I got this to work...

Code:
=SUM(COUNTIFS(Schedule!C4:C250,{"M1","M"},Schedule!B4:B250,"Bell"))

:)
 
Upvote 0

FDibbins

Well-known Member
Joined
Feb 16, 2013
Messages
6,723
Will there be other "M"'s? eg M2, M3 etc, or just M and M1?
If only M and M1....
=countifs(Schedule!B4:B250,"BELL",Schedule!C4:C250,"M?")


If more than just M1...
=SUM(COUNTIFs(Schedule!B4:B250,"BELL",Schedule!C4:C250,{"M", "M1"})

edit: cool, you got what you needed - almost the same as my suggestion :)
 
Last edited:
Upvote 0

AhoyNC

Well-known Member
Joined
Oct 10, 2011
Messages
5,190
Office Version
  1. 365
Platform
  1. Windows
Code:
=SUMPRODUCT(--(Schedule!B4:B250="BELL"),(Schedule!C4:C250="M")+(Schedule!C4:C250="M1"))
 
Upvote 0

Anand Sharma

Board Regular
Joined
Nov 22, 2016
Messages
63
use below mentioned formula

=SUMPRODUCT(--(J5:J10="apple"),--(K5:K10="m")+(K5:K10="m1"))

here "+" work as or operator
 
Upvote 0

Forum statistics

Threads
1,191,203
Messages
5,985,248
Members
439,953
Latest member
suchitha

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
Top