search for (name, date amount) together based on sheets names and copy across sheets

Ali M

Active Member
Joined
Oct 10, 2021
Messages
288
Office Version
  1. 2019
  2. 2013
Platform
  1. Windows
Hi
in DAILY sheet I have items contains sheet name in last part example (FROM ALI , FROM OMAR ,....)
and I have sheets names ALI and OMAR so I want matching in last PART in the item in column B with sheets names based on DATE & AMOUNT together even duplicates the same amount and date for the same name should brings . if I have the items in DAILY sheet for CUSTOMER NAME doesn't exist in CUSTOMER sheet based on matching date, amount and last part the item with sheet name then should copy to sheet is relation of it as I highlighted by red in DAILY sheet (those are not existed in ALI, OMAR sheet ) so should add to them and delete FROM ALI, FROM OMAR) , I don't need it to show in customers sheets .
if I have the items in CUSTOMERS sheets and don't existed in DAILY sheet as I highlighted by blue then should copy to DAILY sheet and add in last part of the ITEM "FROM ALI, FROM OMAR based on matching date, amount and last part the item with sheet name .
any item doesn't contain the sheet name in last part in DAILY sheet should ignore it and any word "OPENING BALANCE" also should ignores from customers sheets when matching.
every time I add new sheets and change data in all of sheets so should update every time run the macro.
also posted here
search for (name, date amount) together based on sheets names and copy across sheets


original data in sheets
copy (3) (1).xlsm
ABCDE
1DATEACCOUNT NAMEDEBIT CREDITBALANCE
220/06/2023PURCHASE FROM OMAR15,000.0015,000.00
321/06/2023CASH PR FROM ALI15,000.0030,000.00
421/06/2023STOCK1100,000.00130,000.00
522/06/2023CASH DM FROM ALI37,000.0093,000.00
622/06/2023EXPENSE ADMIN65,000.0028,000.00
722/06/2023PURCHASE RETURNS FROM OMAR14,000.0014,000.00
822/06/2023PURCHASE RETURNS FROM ALI3,200.0010,800.00
922/06/2023PURCHASE RETURNS FROM ALI3,200.007,600.00
1022/06/2023PURCHASE LOW 6,200.0013,800.00
1122/06/2023EXPENSE PR37,000.0050,800.00
1222/06/2023SALES201,000.00-150,200.00
1322/06/2023SALES RETURNS3,500.00-146,700.00
1423/06/2023SELLING LOW 3,201.00-149,901.00
1524/06/2023SALES FROM OMAR3,202.00-153,103.00
DAILY
Cell Formulas
RangeFormula
E2E2=C2-D2
E3:E15E3=E2+C3-D3





copy (3) (1).xlsm
ABCDE
1ITEMACCOUNT NAMEDEBIT CREDITBALANCE
220/06/2023OPENING BALANCE SALES15,000.0015,000.00
322/06/2023PURCHASE RETURNS4,000.0011,000.00
424/06/2023SALES 3,202.007,798.00
5TOTAL15,000.007,202.007,798.00
OMAR
Cell Formulas
RangeFormula
E2,E5E2=C2-D2
E3:E4E3=E2+C3-D3
C5:D5C5=SUM(C2:C4)



copy (3) (1).xlsm
ABCDE
1DATEACCOUNT NAMEDEBIT CREDITBALANCE
220/06/2023OPENING BALANCE PURCHASE200,000.00200,000.00
321/06/2023CASH PR 15,000.00215,000.00
422/06/2023CASH DM30,000.00185,000.00
523/06/2023CASH DM1,200.00183,800.00
623/06/2023CASH DM1,200.00182,600.00
7TOTAL215,000.0032,400.00182,600.00
ALI
Cell Formulas
RangeFormula
E2,E7E2=C2-D2
E3:E6E3=E2+C3-D3
C7:D7C7=SUM(C2:C6)




result in each sheet
copy (3) (1).xlsm
ABCDE
1DATEACCOUNT NAMEDEBIT CREDITBALANCE
221/06/2023CASH PR FROM ALI15,000.0015,000.00
321/06/2023CASH PR FROM ALI15,000.0030,000.00
422/06/2023CASH DM FROM ALI37,000.00-7,000.00
522/06/2023EXPENSE ADMIN65,000.00-72,000.00
622/06/2023CASH DM FROM ALI30,000.00-102,000.00
723/06/2023CASH DM FROM ALI1,200.00-103,200.00
823/06/2023CASH DM FROM ALI1,200.00-104,400.00
920/06/2023PURCHASE FROM OMAR15,000.00-89,400.00
1022/06/2023PURCHASE RETURNS FROM OMAR4,000.00-93,400.00
1121/06/2023STOCK1100,000.0010,600.00
1222/06/2023PURCHASE RETURNS FROM OMAR14,000.00-3,400.00
1322/06/2023PURCHASE LOW 6,200.002,800.00
1422/06/2023EXPENSE PR37,000.0039,800.00
1522/06/2023SALES201,000.00-161,200.00
1622/06/2023SALES RETURNS3,500.00-157,700.00
1722/06/2023PURCHASE RETURNS FROM ALI3,200.00-160,900.00
1822/06/2023PURCHASE RETURNS FROM ALI3,200.00-164,100.00
1923/06/2023SELLING LOW 3,201.00-167,301.00
2024/06/2023SALES FROM OMAR3,202.00-170,503.00
DAILY
Cell Formulas
RangeFormula
E2E2=C2-D2
E12:E20,E3:E10E3=E2+C3-D3
E11E11=E9+C11-D11



copy (3) (1).xlsm
ABCDE
1ITEMACCOUNT NAMEDEBIT CREDITBALANCE
220/06/2023OPENING BALANCE SALES15,000.0015,000.00
320/06/2023PURCHASE15,000.0030,000.00
422/06/2023PURCHASE RETURNS14,000.0016,000.00
522/06/2023PURCHASE RETURNS4,000.0012,000.00
624/06/2023SALES 3,202.008,798.00
7TOTAL30,000.0021,202.008,798.00
OMAR
Cell Formulas
RangeFormula
E2,E7E2=C2-D2
E3:E6E3=E2+C3-D3
C7:D7C7=SUM(C2:C6)


copy (3) (1).xlsm
ABCDE
1DATEACCOUNT NAMEDEBIT CREDITBALANCE
220/06/2023OPENING BALANCE PURCHASE200,000.00200,000.00
321/06/2023CASH PR 15,000.00215,000.00
421/06/2023CASH PR15,000.00230,000.00
522/06/2023CASH DM37,000.00193,000.00
622/06/2023PURCHASE RETURNS3,200.00189,800.00
722/06/2023PURCHASE RETURNS3,200.00186,600.00
822/06/2023CASH DM30,000.00156,600.00
923/06/2023CASH DM1,200.00155,400.00
1023/06/2023CASH DM1,200.00154,200.00
11TOTAL230,000.0075,800.00154,200.00
ALI
Cell Formulas
RangeFormula
E2,E11E2=C2-D2
E3:E10E3=E2+C3-D3
C11:D11C11=SUM(C2:C10)


thanks
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,215,094
Messages
6,123,071
Members
449,092
Latest member
ipruravindra

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