Forum Discussion

S_L_E's avatar
S_L_E
Copper Contributor
Aug 12, 2025

Best method to find variances between checkbook deposits and GL deposit transactions

I'm looking for a way to find variances between checkbook deposits and General Ledger deposit transactions.  Single checkbook deposits post to the GL as multiple entries (deposits are exported to the GL from a different platform).  For example, a single deposit of $10,000 in the checkbook may actually be 5 checks of $2000 each, which post to the GL individually. This wouldn't be an issue except there are often over 3000 individual GL entries and 1000+ checkbook deposits in a given month. I need to determine which groups of GL entries equal each checkbook deposit in order to find the variance.  Below is a very simplified version of what I'm looking at. I have tried subtotaling by date, but this doesn't work well, because each checkbook deposit can send entries to the GL with multiple check dates. I have considered Solver, but this problem seems too complicated for that method. Is there a way to do this in Excel, or do I need something more sophisticated?  I am an advanced Excel user, but the answer to my problem has eluded me, so far.

 

Thanks for your help.

 

6 Replies

  • flexyourdata's avatar
    flexyourdata
    Iron Contributor

    One idea to consider is a recursive lambda function that processes one check at a time, assigning the check number to as many GL entries as necessary before processing the next check. 

    The function RECONCILE is defined like this, with comments for clarity:

    RECONCILE = LAMBDA(checks, ledger_entries,
    
        LET(
            // Add an empty column for the ledger check numbers if necessary
            ledger_entries,IF(COLUMNS(ledger_entries)=1,HSTACK(ledger_entries,EXPAND(0,ROWS(ledger_entries),1,0)),ledger_entries),
            // get the column with the ledger check numbers
            ledger_checks, TAKE(ledger_entries,,-1),
            // get the ledger amounts, with already-assigned amounts zeroed out
            adj_ledger_amounts, IF(ledger_checks<>0,0,TAKE(ledger_entries,,1)),
            // running sum on the adjusted ledger amounts
            scanner, SCAN(0, adj_ledger_amounts, SUM),
            // drop the processed row
            new_checks, DROP(checks,1),
            // if the scanner is zero, then the ledger check num is already assigned
            // so use it, otherwise if the value from the running sum is
            // less than or equal to the deposit of the check being processed, assign
            // the new check amount, otherwise don't change the array
            new_ledger_checks, IFS(scanner=0,ledger_checks,scanner<=INDEX(checks,1,3),INDEX(checks,1,1),TRUE,ledger_checks),
            // replace the ledger-checks column with the newly calculated array
            new_ledger_entries, HSTACK(DROP(ledger_entries,,-1),new_ledger_checks),
            IF(
                // if new_checks is an error, dropping a row has resulted in an empty array
                // which means the recursion is finished
                ISERROR(AND(new_checks)),
                // and just return the new ledger checks 
                new_ledger_checks,
                // otherwise, process the next row
                RECONCILE(new_checks,new_ledger_entries)
            )
        )
    
    );

     

    Assumptions:

    • GL entries for check n are all added to the ledger before check n+1
    • Checks table has three columns. Headers aren't important, but column 1 should hold a unique identifier for the check and column 3 should hold the check deposit amount
    • The initial call to RECONCILE should have a single-column in the second argument

     

    This assigns entire ledger entries to a single check. If the n+1th ledger entry is too large for what remains in the check's deposit amount, it won't be assigned and will be assigned to the next check. 

    Applying a simple SUMIF of the GL Deposit by Check ID next to the check amount would help find rows which aren't fully accounted for. 

    =SUMIF(H2#,A2:A3,G2:G9)

     

    • S_L_E's avatar
      S_L_E
      Copper Contributor

      Thank you!  I'm eager to try this.  I'll post back with results.

  • Patrick2788's avatar
    Patrick2788
    Silver Contributor

    There are elegant solutions to finding the subset sum of a given check book deposit total.  However, the fact the checkbook date of 8/1, for example, may have GL deposits from multiple dates is the part that makes this difficult.  If we disregard the GL dates in your example, both 2500 and 4500 have several ways to arrive at those totals.   There must be something in those GL rows that would associate a given entry with the checkbook dates of 8/1 or 8/2, for example.

    • S_L_E's avatar
      S_L_E
      Copper Contributor

      Thank you for your reply.  

      There must be something in those GL rows that would associate a given entry with the checkbook dates of 8/1 or 8/2, for example.

      Unfortunately, there is not.  This is the sad reality of merging data from two different platforms (at least the two we have 😕).  While there is technically a partial deposit ID associated with the GL pieces, there is no easy way to connect it to the data and export truncates the ID, removing the unique identifier.

      Thanks again for your help.

  • =IFNA(INDEX($B$2:$B$5,MATCH(SUM($F$2:F2),$C$2:$C$5,0)),"")

    This returns the expected result in my sample sheet.

    =SUM($B$2:B2)

    This is the formula in cell C2 that creates a helper column.

     

    The assumption is that each checkbook deposit is fully distributed to the general ledger account before the next deposit is distributed to the general ledger.

     

    • S_L_E's avatar
      S_L_E
      Copper Contributor

      Thank you.  I was excited to try the formulas, but I am finding that the GL pieces are exported randomly and arranged by date.  It does not appear that a deposit is fully distributed to the GL before the next deposit is distributed. However, I will keep this in mind for other applications.

       

      Thanks for your help!

Resources