• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Need help in criteria based formula for daily Cash Book (attach: Sample workbook)

inddon

Member
Hello There,

I have a defined a Cash Book table and a setup table which handles petty cash of various departments.

I need help in constructing a formula for deriving the closing balance. This is based on some criteria as described below. Also, attached a sample workbook with the description for your reference.


Case:
There are various divisions which contributes to the daily organizational expenses.
Expenses which are paid only by Division 'Third Division', needs to be paid back to them.

There is a Setup table Table2. This has the division names where the amount needs to be paid back to that Division. All those Divisions would be listed here. This will be reflected in Table1 column Closing Balance.

Requirement in Table1:
The column 'Closing Balance' should be calculated as follows:
1. Closing Balance= Previous rows 'Closing Balance' + current row's 'Begin Balance' - current rows 'Expense Amount' (**). Any new 'Begin balance' will be added to the 'Closing Balance'
2. (**) If column 'Type' = 'Bank Withdrawal' then current rows 'Closing Balance' = previous rows 'Closing Balance' + current rows 'Begin Balance'
3. (**) When a new row is created, then previous rows 'Closing Balance' is carried forward to the new row
4. (**) Check if row column 'Expense Paid By' value exists in Table2 column Division.
If Not exists, then carry forward the previous rows 'Closing Balance' to the current row
If Yes, and if Status = 'Paid", then include the current rows column 'Expense Amount' value in the 'Closing Balance' calculation


Could you please advise on the solution.


Many thanks and look forward to hearing from you.

Regards,
Don
 

Attachments

  • Sample Workbook.xlsx
    13.6 KB · Views: 9
Try,

In J4, copy down :

=SUBTOTAL(109,F$4:F4)-SUBTOTAL(109,H$4:IF(I4="Not Paid",H3,H4))

Regards


Hi Bosco,

Thank you for the formula. I realized, I made a slight mistake in the description of closing balance figures.

The amount needs to be included in the calculation, only when the status is "Paid", else not. I tried to modify your formula, but in vain.

Could you please advise. I have attached the updated workbook for your reference. Also, could you in brief explain for my knowledge how this subtotal works, appreciate your help.

Thanks and look forward to hearing from you.

Regards,
Don
 

Attachments

  • Sample Workbook.xlsx
    14.4 KB · Views: 5
Hi Bosco,

Thank you for the formula. I realized, I made a slight mistake in the description of closing balance figures.

The amount needs to be included in the calculation, only when the status is "Paid", else not. I tried to modify your formula, but in vain.

Could you please advise. I have attached the updated workbook for your reference. Also, could you in brief explain for my knowledge how this subtotal works, appreciate your help.

Thanks and look forward to hearing from you.

Regards,
Don
Try to replace the formula by,

J4, formula copy down :

=SUBTOTAL(109,F$4:F4)-SUMPRODUCT(SUBTOTAL(109,OFFSET(H$4,ROW(H$4:H4)-ROW(H$4),0,1))*(I$4:I4="Paid"))

Edit : In order to know how the Subtotal function work, please check the Excel Help File by pressing F1 in search for Subtotal function.

Regards
Bosco
 

Attachments

  • FilterSum.xlsx
    15.4 KB · Views: 10
Last edited:
Back
Top