Array Formula w/ 4 or 5 Criteria

Stacy_Sutton

New Member
Joined
Jun 1, 2011
Messages
8
Is there a limit to the number of criteria that can be used in an array formula? I think my formula is correct but it's not working. I suspect it might be a format issue. I'm sure this can be done but maybe I'm not using the best formula.

I have a list of data (CM's 2-1-11 To 1-31-12) where each row contains:

Customer ID (Col. C)
Period (Col. F)
G/L Account (Col. H)
Amount (Col. K)
Brand (Col. L)
Prior Year Adjustment Flag (Y or N) (Col. M)

I am trying to report summarized totals by customer, brand, G/L account, and period. I need to exclude any amounts that have Y in the prior year adjustment column and instead show those in the prior year totals. Each customer has their own worksheet which contains a section for each brand with lines for each G/L account and columns for each month (period). Details for these worksheets are:

Customer ID = AR6
Brand 1 = AQ7, Brand 2 = AQ43
Date For Period 1 = AS7, Period 1 Prior Year Adj. Col. = AT (not sure if I need this)
G/L Account 1 = AR8, G/L Account 2 = AR9, AR10, AR11 etc.

The formula I'm currently using (which is not resulting in an error but is providing no result at all) is:

{=SUM('CM''s 2-1-11 To 1-31-12'!$C$5:$C$1568=$AR$6)*('CM''s 2-1-11 To 1-31-12'!$F$5:$F$1568=$AS$7)*('CM''s 2-1-11 To 1-31-12'!$H$5:$H$1568=$AR8)*('CM''s 2-1-11 To 1-31-12'!$L$5:$L$1568=$AQ$7)*('CM''s 2-1-11 To 1-31-12'!$K$5:$K$1568)}

Help please? Any suggestions how I can make this work?
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Try resizing the formula to something with like ten rows...

{=SUM('CM''s 2-1-11 To 1-31-12'!$C$5:$C$15=$AR$6)*('CM''s 2-1-11 To 1-31-12'!$F$5:$F$15=$AS$7)*('CM''s 2-1-11 To 1-31-12'!$H$5:$H$15=$AR8)*('CM''s 2-1-11 To 1-31-12'!$L$5:$L$15=$AQ$7)*('CM''s 2-1-11 To 1-31-12'!$K$5:$K$15)}

And then use the Evaluate Formula tool to see what's going on.

[EDIT]

DOH!

It's SUMPRODUCT() not SUM(). No need to array enter. Geez! :oops:
 
Last edited:
Upvote 0
I've never used SUMPRODUCT before. I tried looking at the formula evaluator and it looked like I was getting results. I'll try this in the morning (my time in CA) and see how it goes.

Thanks for your help!
 
Upvote 0
Does "no result at all" mean that you see the formula itself in the cell or 0?

On Excel 2007 or later:
Code:
=SUMIFS(
    'CM''s 2-1-11 To 1-31-12'!$K$5:$K$1568,
    'CM''s 2-1-11 To 1-31-12'!$C$5:$C$1568,$AR$6,
    'CM''s 2-1-11 To 1-31-12'!$F$5:$F$1568,$AS$7,
    'CM''s 2-1-11 To 1-31-12'!$H$5:$H$1568,$AR8,
    'CM''s 2-1-11 To 1-31-12'!$L$5:$L$1568,$AQ$7,
    'CM''s 2-1-11 To 1-31-12'!$M$5:$M$1568,"<>Y")

On all versions...
Code:
=SUMPRODUCT(
    'CM''s 2-1-11 To 1-31-12'!$K$5:$K$1568,
    --('CM''s 2-1-11 To 1-31-12'!$C$5:$C$1568=$AR$6),
    --('CM''s 2-1-11 To 1-31-12'!$F$5:$F$1568=$AS$7),
    --('CM''s 2-1-11 To 1-31-12'!$H$5:$H$1568=$AR8),
    --('CM''s 2-1-11 To 1-31-12'!$L$5:$L$1568=$AQ$7),
    --('CM''s 2-1-11 To 1-31-12'!$M$5:$M$1568<>"Y"))

As Greg notes, when in doubt about the result of a formula, try to evaluate it on ranges of a reduced size.
 
Last edited by a moderator:
Upvote 0
No result at all means I'm seeing zero in the cell.

I'm off to try your tips and see what happens.

Thanks for your help!
 
Upvote 0
Ok I used the SUMIFS and it's working!! Thank you so much for the support. I knew this could be done but it was just beyond my reach!

You guys have a great day! :)
 
Upvote 0
I overlooked the fact that I have users who are still on Excel 2003 so they are having trouble viewing the results of my SUMIF formulas. I need to change the formulas to SUMPRODUCT (and hope they'll still work).

Just to make sure... I omit the multiple occurrences of "--" in the example provided, right?

=SUMPRODUCT(
'CM''s 2-1-11 To 1-31-12'!$K$5:$K$1568,
--('CM''s 2-1-11 To 1-31-12'!$C$5:$C$1568=$AR$6),
--('CM''s 2-1-11 To 1-31-12'!$F$5:$F$1568=$AS$7),
--('CM''s 2-1-11 To 1-31-12'!$H$5:$H$1568=$AR8),
--('CM''s 2-1-11 To 1-31-12'!$L$5:$L$1568=$AQ$7),
--('CM''s 2-1-11 To 1-31-12'!$M$5:$M$1568<>"Y"))

Thanks again!
 
Upvote 0
I overlooked the fact that I have users who are still on Excel 2003 so they are having trouble viewing the results of my SUMIF formulas. I need to change the formulas to SUMPRODUCT (and hope they'll still work).

Just to make sure... I omit the multiple occurrences of "--" in the example provided, right?

=SUMPRODUCT(
'CM''s 2-1-11 To 1-31-12'!$K$5:$K$1568,
--('CM''s 2-1-11 To 1-31-12'!$C$5:$C$1568=$AR$6),
--('CM''s 2-1-11 To 1-31-12'!$F$5:$F$1568=$AS$7),
--('CM''s 2-1-11 To 1-31-12'!$H$5:$H$1568=$AR8),
--('CM''s 2-1-11 To 1-31-12'!$L$5:$L$1568=$AQ$7),
--('CM''s 2-1-11 To 1-31-12'!$M$5:$M$1568<>"Y"))

Thanks again!

It should succeed as is. The -- bit does effect coercion from TRUE/FALSE values (results of equality or unequality evaluations) into 1/0's for SumProduct needs numbers to work.

Note that you can check this formula also on your 2007/2010 version in order to see that it works.
 
Upvote 0

Forum statistics

Threads
1,224,552
Messages
6,179,488
Members
452,917
Latest member
MrsMSalt

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