Hi guys,
I am looking for your Google Sheets expertise.
I’m trying to combine ARRAYFORMULA, VLOOKUP, QUERY together.
If I take off the “AND Col1 <= DATE '”&TEXT(F2:F,“yyyy-mm-dd”)&" " part it works perfectly, but if I do want to include it, the first row is the only row that works as expected.
=ARRAYFORMULA(VLOOKUP(
A2:A,
QUERY(
{‘Income’!A2:A&‘Income’!C2:C,‘Income’!B2:B},
“SELECT Col1, SUM(Col2) WHERE Col1 >= DATE '”&TEXT(E2:E,“yyyy-mm-dd”)&“’ AND Col1 <= DATE '”&TEXT(F2:F,“yyyy-mm-dd”)&“’ GROUP BY Col1”,
0
),
2,
0
))
In arrayformula, you can’t use AND logic… use * to multiply values… if the result is not 0… then it is a match…
also… arrayformula will not work with filters (it will only process the first value)… as @gvalero said, you have to create workaround using vlookups and if formulas
Calculating this over Glide is quite straight forward, but I do need it in excel for cross reference etc.
A bit about what I’m trying to do:
Table A is a log of all my incomes: Row ID | Category ID | Value | Transaction date
Table B is a smart summary of the transaction sum, grouped by the category ID and transaction period:
Row ID | Category ID | Expected income | From date | To date
In table B, the same category can point to different periods (From → To dates), and the matching incomes from table A (both Category ID and date period) should be aggregated.
So you log all your incomes into table A, and table B is where you want to combine those logs into certain periods grouped by category? Is “Expected income” the column where the formula should be used?