Chris said:
Ok, so say on Sheet20, you have a calendar, and below each date listed is a
blank.
Jan 09
1 2 3 4 5 6 7
* * * * * * *
8 9 10 11 12 13 14
* * * * * * *
15 16 17 18 19 20 21
* * * * * * *
22 23 24 25 26 27 28
* * * * * * *
29 30 31
* * *
I'll assume the Jan 09 is in cell Sheet20!A1 and is text, the 1 below
it is in cell Sheet20!A2, etc, so the whole thing spans Sheet20!
A1:G11.
On Sheet18, you would see the following, just many many more rows:
150 55555-01 1 1 1 0 0 0 0 3 0 0 1/10
101 55555-03 1 1 0 0 1 0 0 1 0 0 5/15
102 55555-04 1 1 1 0 1 0 0 4 0 1 4/23
101 55555-01 0 0 0 0 0 0 1 0 0 0 3/10
I'll assume there's a header row you're not showing, so this fragment
of the table spans Sheet18!A2:M5. I'll also assume the dates in column
M are date values formatted as m/d.
On Sheet1 you have multipliers, or points, that each item for sale is worth.
So if item 1 was worth 1 point, you'd get 1 point each time you sold it.
There are 10 items with points that vary depending on the item. The
multipliers on Sheet1 are located in cells H1-H10. On Sheet18, you only have
the quantity for each item sold in its particular column.
OK, point values are in Sheet1!H1:H10, so a vertical array in contrast
to the horizontal arrays of units sold for each item in the records in
Sheet18. This isn't an issue since you want the sums of the products
of unit counts times point values. The expression
MMULT(Sheet18!C2:L5,Sheet1!H1:H10)
returns an array of the point totals for each record in Sheet18.
What I want is for the "*" on the calendar to be the sum of all rows' point
values in Sheet18 where the date matches above it, so that someone could
easily look at this calendar and say, "I made 5 points on this day, and 23on
this other day"
Then the formula in Sheet20!C5 (1/10) could be the array formula
=SUMPRODUCT(--(Sheet18!$M$2:$M$5=--(C4&" "&$A$1)),
MMULT(Sheet18!$C$2:$L$5,Sheet1!$H$1:$H$10))
It'd be more efficient to add a column to the table in Sheet18 in the
first blank column to the right of the existing table, spanning the
same rows as the existing table, and containing the array formula
=MMULT(C2:L#,Sheet1!H1:H10)
where # would be the actual bottommost row in the table. I'll assume
this could go into column N. Then in Sheet20 you could use the simpler
formula
Sheet20!C5:
=SUMIF(Sheet18!$M$2:$M$#,--(C4&" "&$A$1),Sheet18!$N$2:$N$#)
Copy Sheet20!C5 and paste into the other cells in Sheet20 that need
similar formulas.