Forum Discussion

mjhowe29's avatar
mjhowe29
Copper Contributor
Aug 17, 2023
Solved

Expanding on a working formula.

I am using the following formula which will look at income sources in a table and adjust a balance column accordingly with each entry:   =SUMPRODUCT([Amount], --([Date]<=[@Date]), ([Type]<>"Income"...
  • mathetes's avatar
    mathetes
    Sep 12, 2023

    mjhowe29 

     

    It makes a lot of sense. And using the type of formula you were using makes it both more complicated and less flexible than you'd like in the long term. Speaking from experience, I know that any attempt at tracking income vs expense is always going to run into unexpected and new forms of income or expense that also need to be handled. Tax Refund, Gifts, for example, are things you might want to categorize separately, and so on.

     

    SO, the resolution I recommend is a table with one column representing the types and the second column representing the factor that makes it positive or negative.

    The list on the left also, conveniently, serves as the source for the drop down in the ledger.

    The formula then can be simple, and, since the variables are not hard-coded in the formula, far more flexible:

    =IFERROR(F2+(D3*(VLOOKUP(B3,Table1,2,0))),"")

     

     

    See the attached

Resources