Sumproduct, OR in condition?

larindom

New Member
Joined
Jun 17, 2015
Messages
7
Hi,

I need a little help. I believe it should be possible with Sumproduct, but I am not entirely sure.

I have a dataset that looks like this:

Monday 1
Tuesday 2
Wednesday 3
Monday 1

I want the sumproduct to sum all instances that says Monday OR Tuesday, so the result is 4. How do I do that?

Brgds,
Lasse
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Assuming that the days are text not dates formatted to show the day then this should work. Where A1:A4 has the days and B1:B4 has the numbers
Code:
=SUMPRODUCT(--(A1:A4="Monday")*B1:B4+--(A1:A4="Tuesday")*B1:B4)
 
Upvote 0
1. Better...

=SUM(SUMIFS(B:B,A:A,{"Monday","Tuesday"}))

2. Or if needed...

=SUMPRODUCT($B$2:$B$5,--ISNUMBER(MATCH($A$2:$A$5,{"Monday","Tuesday"},0)))
 
Upvote 0
Hi pgc01 - your solution seems the simplest... but I cannot make it work?

I am on a European computer and have written this (adjusted for Danish and my dataset):
=SUMPRODUCT(--(D:D={"Fredag";"Tirsdag"});H:H)

I like your solution, as I have to include other criterias as well. Which means that my dataset might look more like:
Monday West 2
Tuesday East 4
Wednesday West 5
Friday East 1
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,388
Members
448,957
Latest member
Hat4Life

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