calculation amounts for BANK & CASH across sheets based on matching partial item

Omran Y

Board Regular
Joined
Jul 17, 2023
Messages
60
Office Version
  1. 2013
Platform
  1. Windows
Hi
the result should be in G2,G3 for BALANCES sheet.
in column (RECEIVED/PAID/NOT PAY) as in header for each sheet contains BANK or CASH should merge amounts are existed in last column with exclude AGGREGATE row from calculation across sheets first .
second should subtract the merged amounts from each other of them (RECEIVED -PAID) for BANK or CASH .
after that should sum the balance to B2,B3
example:
when merge RECEIVED for BANK for three sheets(SL,RS,VC)
RECEIVED BANK=40400+13400+480+120+200=54600
when merge PAID for BANK for four sheets(SL,RS,EP,VC)
PAID BANK=15000+2620+1100+1100+11500+1500+200+200=33200
after that should be 54600-33200=21380
final step when show the result in G2 for BANK should add to B2 will be like this=
21380+200000=221380 as show in G2
the same thing for CAH whether PAID or RECEIVED.
any suggestion to do that by formula or vba will be great.


BANK.xlsm
ABCDEFGH
1ITEMDATECLIENTIDRECEIVED/PAID/NOT PAYQTYUNIT PRICETOTAL
2101/01/2024OMRANFSLOO90RECEIVED CASH RE2000200.00100.0020,000.00
3201/01/2024OMRANSDK-100RECEIVED CASH RE200020.00110.002,200.00
4AGGREGATE22,200.00
5101/01/2024OMAARTTR-1000NOT PAY22.00120.002,640.00
6AGGREGATE2,640.00
7102/01/2024AMIRTRE400-90RECEIVED BANK SWIFT 234441222120.00110.0013,200.00
8202/01/2024AMIRTRE400-91RECEIVED BANK SWIFT 23444122212.00130.001,560.00
9302/01/2024AMIRTRE400-92RECEIVED BANK SWIFT 234441222122.00120.0014,640.00
10402/01/2024AMIRTRE400-93RECEIVED BANK SWIFT 234441222100.00110.0011,000.00
11AGGREGATE40,400.00
12102/01/2024AMIRTTR-1000RECEIVED BANK CHEQUE 12220.00120.002,400.00
13202/01/2024AMIRTTR-1001RECEIVED BANK CHEQUE 122100.00110.0011,000.00
14AGGREGATE13,400.00
SL
Cell Formulas
RangeFormula
H12:H13,H7:H10,H5,H2:H3H2=F2*G2
H4,H14H4=SUM(H2:H3)
H6H6=H5
H11H11=SUM(H7:H10)


BANK.xlsm
ABCDEFGH
1ITEMDATECLIENTIDRECEIVED/PAID/NOT PAYQTYUNIT PRICETOTAL
2101/01/2024MUHFSLOO90PAID CASH AS200010.00110.001,100.00
3AGGREGATE1,100.00
4101/01/2024NURIFSLOO90NOT PAY22.00110.002,420.00
5AGGREGATE2,420.00
6102/01/2024ANURFSLOO90PAID BANK SWIFT 234441288120.00110.0013,200.00
7202/01/2024ANURTRE400-91PAID BANK SWIFT 23444128812.00150.001,800.00
8AGGREGATE15,000.00
9102/01/2024ANURFSLOO90PAID BANK CHEQUE 1221120.00120.002,400.00
10202/01/2024ANURTTR-1001PAID BANK CHEQUE 1221110.0022.00220.00
11AGGREGATE2,620.00
12102/01/2024ANURFSLOO90PAID CASH AS20001120.00120.002,400.00
13AGGREGATE2,400.00
14102/01/2024NURIFSLOO90NOT PAY2.00110.00220.00
15AGGREGATE220.00
PR
Cell Formulas
RangeFormula
H2,H14,H12,H9:H10,H6:H7,H4H2=F2*G2
H3,H13H3=SUM(H2:H2)
H5,H15H5=H4
H8,H11H8=SUM(H6:H7)


BANK.xlsm
ABCDEFGH
1ITEMDATECLIENTIDRECEIVED/PAID/NOT PAYQTYUNIT PRICETOTAL
2102/01/2024ANURFSLOO90NOT PAY1.00120.00120.00
3202/01/2024ANURTTR-1001NOT PAY1.0022.0022.00
4AGGREGATE142.00
5102/01/2024OMRANTTR-1001PAID BANK SWIFT 2555510.00110.001,100.00
6AGGREGATE1,100.00
7102/01/2024ALITTR-1001PAID BANK CHEQUE 12222210.00110.001,100.00
8AGGREGATE1,100.00
9102/01/2024ALIFSLOO90PAID CASH RE 122221210.00110.001,100.00
10AGGREGATE1,100.00
RP
Cell Formulas
RangeFormula
H9,H7,H5,H2:H3H2=F2*G2
H4H4=SUM(H2:H3)
H6,H10,H8H6=SUM(H5)



BANK.xlsm
ABCDEFGH
1ITEMDATECLIENTEXRECEIVED/PAID/NOT PAYQTYUNIT PRICETOTAL
2102/01/2024NNLABORPAID BANK 1233331.001,500.001,500.00
3202/01/2024NNHIREPAID BANK 1233332.005,000.0010,000.00
4AGGREGATE11,500.00
5102/01/2024MMMSERVICEPAID BANK 1233341.001,500.001,500.00
6AGGREGATE1,500.00
7102/01/2024SSSALARY ESSPAID CASH RE2000111.002,000.002,000.00
8202/01/2024SSSALARY ESDPAID CASH RE2000111.003,000.003,000.00
9AGGREGATE5,000.00
10102/01/2024TTLABORPAID CASH RE2000142.002,000.004,000.00
11AGGREGATE4,000.00
EP
Cell Formulas
RangeFormula
H10,H7:H8,H5,H2:H3H2=F2*G2
H4,H9H4=SUM(H2:H3)
H6H6=SUM(H5)
H11H11=SUM(H10:H10)


BANK.xlsm
ABCDE
1ITEMDATECLIENTRECEIVED/PAID/NOT PAYTOTAL
2102/01/2024OMAARPAID BANK 4444200.00
3202/01/2024NURIPAID BANK 4445200.00
4302/01/2024NURIPAID CASH RE3001110.00
5402/01/2024AMIRPAID CASH RE3002100.00
6502/01/2024SSRECEIVED CASH RE400011100.00
7603/01/2024SSRECEIVED CASH RE400012110.00
8704/01/2024SSRECEIVED BANK SWIFT RE400013120.00
9805/01/2024SSRECEIVED BANK CHEQUE CR1000200.00
VC



before
BANK.xlsm
ABCDEFG
1FIRST DURETIONBALANCESACCOUNTSBALANCES
2BANK200,000.00BANK
3CASH300,000.00CASH
BALANCES



after
BANK.xlsm
ABCDEFG
1FIRST DURETIONBALANCESACCOUNTSBALANCES
2BANK200,000.00BANK221,380.00
3CASH300,000.00CASH311,200.00
BALANCES
Cell Formulas
RangeFormula
G2:G3G2=B2+SL!L2-PR!K2
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Correction for two sheets
BANK.xlsm
ABCDEFGH
1ITEMDATECLIENTIDRECEIVED/PAID/NOT PAYQTYUNIT PRICETOTAL
2101/01/2024OMRANFSLOO90RECEIVED CASH RE2000200.00100.0020,000.00
3201/01/2024OMRANSDK-100RECEIVED CASH RE200020.00110.002,200.00
4AGGREGATE22,200.00
5101/01/2024OMAARTTR-1000NOT PAY22.00120.002,640.00
6AGGREGATE2,640.00
7102/01/2024AMIRTRE400-90RECEIVED BANK SWIFT 234441222120.00110.0013,200.00
8202/01/2024AMIRTRE400-91RECEIVED BANK SWIFT 23444122212.00130.001,560.00
9302/01/2024AMIRTRE400-92RECEIVED BANK SWIFT 234441222122.00120.0014,640.00
10402/01/2024AMIRTRE400-93RECEIVED BANK SWIFT 234441222100.00110.0011,000.00
11AGGREGATE40,400.00
12102/01/2024AMIRTTR-1000RECEIVED BANK CHEQUE 12220.00120.002,400.00
13202/01/2024AMIRTTR-1001RECEIVED BANK CHEQUE 122100.00110.0011,000.00
14AGGREGATE13,400.00
SL
Cell Formulas
RangeFormula
H12:H13,H7:H10,H5,H2:H3H2=F2*G2
H4,H14H4=SUM(H2:H3)
H6H6=H5
H11H11=SUM(H7:H10)






BANK.xlsm
ABCDEFGH
1ITEMDATECLIENTIDPAY/NOT PAYQTYUNIT PRICETOTAL
2102/01/2024ALIATRE400-90PAID CASH RE 1222210.00110.001,100.00
3202/01/2024ALIATRE400-91PAID CASH RE 122222.00130.00260.00
4302/01/2024ALIATRE400-92PAID CASH RE 122222.00120.00240.00
5AGGREGATE1,600.00
6102/01/2024AMIRTRE400-90RECEIVED BANK CHEQUI 1222.00110.00220.00
7202/01/2024AMIRTRE400-91RECEIVED BANK CHEQUI 1222.00130.00260.00
8AGGREGATE480.00
9102/01/2024OMRANFSLOO90PAID CASH MR344410.00100.001,000.00
10AGGREGATE1,000.00
11102/01/2024ALIATRE400-92NOT PAY1.00120.00120.00
12AGGREGATE120.00
13102/01/2024OMARTRE400-91NOT PAY2.00130.00260.00
14AGGREGATE380.00
RS
Cell Formulas
RangeFormula
H13,H11,H9,H6:H7,H2:H4H2=F2*G2
H5H5=SUM(H2:H4)
H8,H14H8=SUM(H6:H7)
H10,H12H10=SUM(H9:H9)



and correction details


from
when merge PAID for BANK for four sheets(SL,RS,EP,VC)
PAID BANK=15000+2620+1100+1100+11500+1500+200+200=33200
to
when merge PAID for BANK for four sheets(PR,RP,EP,VC)
PAID BANK=15000+2620+1100+1100+11500+1500+200+200=33200
 
Upvote 0
another correction for result in BALANCES sheet
BANK.xlsm
BCDEFG
1BALANCESACCOUNTSBALANCES
2200,000.00BANK220420
3300,000.00CASH306000
4
BALANCES

sorry about all of theses error !
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,115
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top