Can someone explain to me how my sumproduct formula works?

rob36

Board Regular
Joined
Jul 12, 2010
Messages
57
=SUMPRODUCT(--('Query Info'!$D$1:$D$65000=Code!$L32),--('Query Info'!$F$1:$F$65000=Code!N$2,'Query Info'!$I$1:$I$65000)

Column D is a zone number, F is a door number, and I is ticket numbers. It currently takes each zone, breaks it down by door, and lists the total number of tickets. I need to add a feature so that an additional column (BATCH NUMBER), will be looked into as well. By this, I mean that it will not sum the tickets unless the batch number is = to a certain value.

Thanks!

Excel Workbook
ABCDEFGHI
11
2
3LOAD
4LOADTRIPZNBINDOORDIVITM
5DTNONONONONONOTICKETS
6-------------------------------------------------------
78/5/201010B717.94E+0865671164311
88/5/201010A097.81E+0866642701211
98/5/201010B717.91E+08726092180545
108/5/201010AJP7.91E+0874606218741
118/5/201010A097.65E+0874642701512
128/5/201010A097.65E+0874646946831
138/5/20106A097.65E+0874642701812
148/5/20106A097.65E+0874609593551
158/5/20106A097.65E+0874642711231
168/5/20106A097.65E+087460912552
178/5/20106A097.65E+0874642701011
188/5/20106A097.81E+0874609139901
Query Info
Excel 2002



this is a little view of the data i'm dealing with.
 
I think you are just trying to sum the number of tickets right? So you don't need a sumproduct, because that multiples two columns and then sums them together. I would use the CSE formula.

=SUM(IF('Query Info'!$D$7:$D$65000=Code!$L32),if('Query Info'!$F$7:$F$65000=Code!N$2),if('Query Info'!$C$7:$C$65000= 'Purdue Actual Tool'!$G$1),'Query Info'!$I$1:$I$65000)))

After you enter the formula hit ctrl-shift-enter. Not just enter.
 
Upvote 0

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
I think my () might be off...

=SUM(IF('Query Info'!$D$7:$D$65000=Code!$L32),if('Query Info'!$F$7:$F$65000=Code!N$2),if('Query Info'!$C$7:$C$65000= 'Purdue Actual Tool'!$G$1,'Query Info'!$I$1:$I$65000)))
 
Upvote 0
There are alternatives to SUMPRODUCT, e.g. using an "array formula" as nancymk suggests, but I'd expect both formulas to give the same results. Your SUMPRODUCT formula is valid but you probably have some sort of issue with data mismatches. Try using a cut down version of 10 rows, e.g.

=SUMPRODUCT(--('Query Info'!$D$1:$D$10=Code!$L32),--('Query Info'!$F$1:$F$10=Code!N$2),--('Query Info'!$C$1:$C$10= 'Purdue Actual Tool'!$G$1),'Query Info'!$I$1:$I$10)

You may need to change the data in those 10 rows to ensure that you get a >0 result.

If that still gives zero then I suggest you check each part of the formula. In the formula bar if you select each part in turn, e.g. select just

--('Query Info'!$D$1:$D$10=Code!$L32)

and press F9 key to display the results. Make sure it displays what you expect, e.g. if there are matches for that criterion in rows 2, 3 and 4 only you should see an array like this

{0;1;1;1;0;0;0;0;0;0}

In this way you can check which of the criteria are giving unexpected results, perhaps you have some spaces in the data which means you don't get a match where you expect......
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,602
Members
449,089
Latest member
Motoracer88

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