Use if function with sumproduct

renren

New Member
Joined
Nov 13, 2013
Messages
4
Hi,
I have been using a spreadsheet for a while that uses the following formula to count the amount of assessments are happening in a given month, the source data is spat out from a system so has lots of columns and rows:

=SUMPRODUCT((TEXT('Company Data'!S:S,"mm-yyyy")="07-2018")*1)

Now I want to use the same forumla but for only specfic people whose names appear in a seportate columm which is 'Company Data'!G:G'

I feel I should be adding a =if 'Company Data'!G:G'="john", SUMPRODUCT((TEXT('Company Data'!S:S,"mm-yyyy")="07-2018")*1), "") but this is totally wrong. nothing seems to work!

Any help would be amazing. Oh is an array formula

Thanks
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Just add another Condition to your Sumproduct, i.e.
Code:
[COLOR=#333333]=SUMPRODUCT((TEXT('Company Data'!S:S,"mm-yyyy")="07-2018")*([/COLOR][COLOR=#333333]'Company Data'!G:G'="john"[/COLOR][COLOR=#333333]))[/COLOR]
 
Upvote 0
Hey, Try this one!


Book1
RSTU
2John7/10/20182
37/10/2018
47/10/2018
5John7/10/2018
67/10/2018
77/10/2018
87/10/2018
97/10/2018
107/10/2018
117/10/2018
Sheet5
Cell Formulas
RangeFormula
U2=SUMPRODUCT((TEXT(S:S,"mm-yyyy")="07-2018")*1*(R:R="John"))
 
Upvote 0
Hey, Try this one!

RSTU
2John7/10/20182
37/10/2018
47/10/2018
5John7/10/2018
67/10/2018
77/10/2018
87/10/2018
97/10/2018
107/10/2018
117/10/2018

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet5

Worksheet Formulas
CellFormula
U2=SUMPRODUCT((TEXT(S:S,"mm-yyyy")="07-2018")*1*(R:R="John"))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Thanks both for your replies, Muhammad's formula worked I think becuase of the *1* bit.
I was trying to add the new condition at the start rather than the end.

Thanks lots for your help!
 
Upvote 0
The "*1" is not necessary. That was just in there originally because you only had one condition, and had to coerce your TRUE values to numeric ones.
Since we are introducing a second condition that we are multiplying by, we no longer need the "*1".

The issue in my formula was an extra quote mark that I got when I copied it directly from your original post (after the G:G):
I feel I should be adding a =if 'Company Data'!G:G'="john", SUMPRODUCT((TEXT('Company Data'!S:S,"mm-yyyy")="07-2018")*1), "") but this is totally wrong. nothing seems to work!
Remove that, and my formula should work just fine:
Code:
[COLOR=#333333]=SUMPRODUCT((TEXT('Company Data'!S:S,"mm-yyyy")="07-2018")*([/COLOR][COLOR=#333333]'Company Data'!G:G="john"[/COLOR][COLOR=#333333]))[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,215,024
Messages
6,122,729
Members
449,093
Latest member
Mnur

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