I've got this sheet where I do some basic accounting, and I want to be able to input the balance in my pocket every once in a while. The idea is that the expenses I record until the next balance will be subtracting from the latest amount recorded (through a form).
In order to achieve this, I'm attempting the following line:
=index(FILTER(J:J,not(ISBLANK(J:J))),rows(filter(J:J,not(ISBLANK(J:J)))),1)-dsum('Respostes hipotetiques'!$A:$E,"Quantitat",{"Cash?","Data de registre";"",">index(FILTER(i:i,not(ISBLANK(i:i))),rows(filter(i:i,not(ISBLANK(i:i)))),1)"})
J:J contains the list of balances, and that part works. The problem lies in the dsum
statement.
"Respostes hipotetiques" is a sheet that holds some fake data, and the amount is recorded in Quantitat. Cash? is either blank or "n" for not cash (I don't want to take a bank transaction into account to update my pocket money), and the "Data de registre" holds the automatic timestamp from the input form for each record of expense.
Lastly, I:I is where the timestamp is held for the fake data.
I've been experimenting with several combinations, and it seems I can't make any operations with cell references in the dsum
criteria. If this is so, is there any way to achieve the intent of what I wrote?
EDIT 12/05/2015
Just to clarify, a verbose description of the thought process the formula is trying to capture is this:
If I had 20 euros/dollars/whatever yesterday at 3pm, subtract only those cash transactions that occurred after yesterday at 3pm.