Forum Discussion

Mike_GilmanRabakami1's avatar
Mike_GilmanRabakami1
Copper Contributor
Dec 30, 2023

need a formula function that takes pos & neg data from separate cols and displays results in another

I have an 8 column spreadsheet that I'm trying to set up in order to maintain my church's financial records.  Column b is for deposits.  Column d is for expenses/withdrawals.  What formula do I enter in column g in order to get a running total line by line when g adds b and subtracts d?

4 Replies

  • Patrick2788's avatar
    Patrick2788
    Silver Contributor

    Mike_GilmanRabakami1 

    I think there are a few ways to approach this task: 1) Use dynamic arrays or 2) Go with a table.

     

    For the attached workbook I've simplified the Check Register Ledger template offered by Excel (File | New - search for templates).

     

    This is a dynamic array solution:

    A negative sign is added before the withdrawal dynamic item because ledgers often do not list withdrawals as negatives but as positives (This template does not use negatives):

    =LET(
        transactions, Deposit + -Withdrawal,
        Accumulate, LAMBDA(a, v, a + v),
        SCAN(0, transactions, Accumulate)
    )

    The Withdrawal and Deposit columns have been defined as dynamic items. Formula is placed in G.

     

    Also, I've attached the less exciting table solution.

     

     

     

    • Mike_GilmanRabakami1's avatar
      Mike_GilmanRabakami1
      Copper Contributor

      Hans my data actuaoly begins on line 3 so I just took your formula and changed the line and cell # by one but the solution didn't work.HansVogelaar 

      • HansVogelaar's avatar
        HansVogelaar
        MVP

        Mike_GilmanRabakami1 

        Could you attach a small sample workbook demonstrating the problem (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar?

Resources