I posted this earlier, but I explained it poorly, so here goes again.
I have a table (called 'Table1') which 2 columns. In column one is each month of 2010 (the first day of each month as a date), in column 2 is a 1 if the month has 31 days, 0 otherwise. In another table ('Table2') I have 10 months (the first day of each month as a date) and in the second column I have a revenue amount associated with that month. I wrote the following array formula:
=SUM(INDEX(Table1, MATCH(Table2[Column1], Table1[Column1], 0), 2) * Table2[Column2])
This should give me the sum of revenue for ONLY those months with 31 days, but instead I get the sum of revenue for ALL the months.
Strangely, when I enter just the piece inside the sum as an array formula (across 10 cells) I get the correct array. That is,
=INDEX(Table1, MATCH(Table2[Column1], Table1[Column1], 0), 2) * Table2[Column2]
Gives me an array with zeros for months with <31 days, and the proper revenue for months with 31 days.
Why isn't the 1-cell array formula working?
Thanks.
I have a table (called 'Table1') which 2 columns. In column one is each month of 2010 (the first day of each month as a date), in column 2 is a 1 if the month has 31 days, 0 otherwise. In another table ('Table2') I have 10 months (the first day of each month as a date) and in the second column I have a revenue amount associated with that month. I wrote the following array formula:
=SUM(INDEX(Table1, MATCH(Table2[Column1], Table1[Column1], 0), 2) * Table2[Column2])
This should give me the sum of revenue for ONLY those months with 31 days, but instead I get the sum of revenue for ALL the months.
Strangely, when I enter just the piece inside the sum as an array formula (across 10 cells) I get the correct array. That is,
=INDEX(Table1, MATCH(Table2[Column1], Table1[Column1], 0), 2) * Table2[Column2]
Gives me an array with zeros for months with <31 days, and the proper revenue for months with 31 days.
Why isn't the 1-cell array formula working?
Thanks.