Create report by matching part of item and populate for each cell under item across sheets

Ali M

Active Member
Joined
Oct 10, 2021
Messages
348
Office Version
  1. 2019
  2. 2013
Platform
  1. Windows
Hello
in SAFE sheet will match header(whole item) from column B to last column with column D across sheet and match part of item in column A from row 2 with column E across sheet after that should merge amount is existed in TOTAL row for last column (TOTAL) for each sheet contains items in column D,E when match with header and column A for SAFE sheet and should calculate as highlighted cells contain formulas . last thing should fill empty cell zero as hyphen .
I would macro to deal with big data for each sheet
ITEMS (1).xlsm
ABCDEF
1ITEMDATEIDINVOICES TYPEINVOICE NOTOTAL
2101/01/2023DFRO200CASH INVOICESPURCHASE INVOICE NO AD333313,000.00
3201/01/2023DFRO201CASH INVOICESPURCHASE INVOICE NO AD33334,000.00
4301/01/2023DFRO202CASH INVOICESPURCHASE INVOICE NO AD33333,000.00
5TOTAL20,000.00
6101/01/2023DFRO203CASH INVOICESPURCHASE INVOICE NO AD33348,000.00
7201/01/2023DFRO204CASH INVOICESPURCHASE INVOICE NO AD33344,000.00
8TOTAL12,000.00
9101/01/2023DFRO203CASH INVOICESPURCHASE INVOICE NO AD33358,000.00
10202/01/2023DFRO204CASH INVOICESPURCHASE INVOICE NO AD333512,000.00
11303/01/2023DFRO205CASH INVOICESPURCHASE INVOICE NO AD3335100,000.00
12404/01/2023DFRO206CASH INVOICESPURCHASE INVOICE NO AD333550,000.00
13505/01/2023DFRO207CASH INVOICESPURCHASE INVOICE NO AD333540,000.00
14606/01/2023DFRO208CASH INVOICESPURCHASE INVOICE NO AD333510,000.00
15TOTAL220,000.00
16106/01/2023DFRO203CASH INVOICESPURCHASE INVOICE NO AD333611,000.00
17TOTAL11,000.00
18106/01/2023DFRO208FORWARD INVOICESPURCHASE INVOICE NO AD333713,000.00
19TOTAL13,000.00
20106/01/2023DFRO207FORWARD INVOICESPURCHASE INVOICE NO AD333811,000.00
21TOTAL11,000.00
22106/01/2023DFRO206FORWARD INVOICESPURCHASE INVOICE NO AD33391,500.00
23TOTAL1,500.00
PURCHASE


ITEMS (1).xlsm
ABCDEF
1ITEMDATEIDINVOICES TYPEINVOICE NOTOTAL
2102/01/2023DFRO201CASH INVOICESSALES INVOICE NO SA12222226,000.00
3202/01/2023DFRO202CASH INVOICESSALES INVOICE NO SA12222226,000.00
4TOTAL12,000.00
5102/01/2023DFRO203CASH INVOICESSALES INVOICE NO SA122222312,000.00
6202/01/2023DFRO206CASH INVOICESSALES INVOICE NO SA122222360,000.00
7302/01/2023DFRO200CASH INVOICESSALES INVOICE NO SA122222328,000.00
8TOTAL110,000.00
9102/01/2023DFRO203FORWARD INVOICESSALES INVOICE NO SA122222412,000.00
10TOTAL12,000.00
11102/01/2023DFRO201FORWARD INVOICESSALES INVOICE NO SA12222256,000.00
12202/01/2023DFRO202FORWARD INVOICESSALES INVOICE NO SA12222256,000.00
13TOTAL12,000.00
14104/01/2023DFRO202CASH INVOICESSALES INVOICE NO SA12222264,000.00
15TOTAL4,000.00
SALES



ITEMS (1).xlsm
ABCDEF
1ITEMDATEIDINVOICES TYPEINVOICE NOTOTAL
2102/01/2023DFRO201FORWARD INVOICESSALES RETURNS INVOICE NO ST344441,000.00
3202/01/2023DFRO202FORWARD INVOICESSALES RETURNS INVOICE NO ST34444200.00
4TOTAL1,200.00
5103/01/2023DFRO202CASH INVOICESSALES RETURNS INVOICE NO ST344452,000.00
6TOTAL2,000.00
7103/01/2023DFRO201CASH INVOICESSALES RETURNS INVOICE NO ST344463,000.00
8TOTAL3,000.00
9103/01/2023DFRO202FORWARD INVOICESSALES RETURNS INVOICE NO ST344471,400.00
10TOTAL1,400.00
11104/01/2023DFRO201CASH INVOICESSALES INVOICE NO SA12222264,000.00
12TOTAL4,000.00
SALES RETURNS


ITEMS (1).xlsm
ABCDEF
1ITEMDATEIDINVOICES TYPEINVOICE NOTOTAL
2103/01/2023DFRO202FORWARD INVOICESPURCHASE RETURNS INVOICE NO PR 12222,200.00
3TOTAL2,200.00
4103/01/2023DFRO201CASH INVOICESPURCHASE RETURNS INVOICE NO PR 12231,300.00
5TOTAL1,300.00
6103/01/2023DFRO201CASH INVOICESPURCHASE RETURNS INVOICE NO PR 12241,400.00
7TOTAL1,400.00
PURCHASE RETURNS




ITEMS (1).xlsm
ABCDE
1ITEMDATE VOUCHER TYPEVOUCHER NOTOTAL
2101/02/2023CASH INCAH IN VOUCHER NO 122223,000.00
3201/02/2023CASH INCAH IN VOUCHER NO 1222312,000.00
4301/02/2023CASH OUTCAH OUT VOUCHER NO 444441,000.00
5401/02/2023CASH INCAH IN VOUCHER NO 122243,000.00
6502/02/2023CASH OUTCAH OUT VOUCHER NO 444455,000.00
7602/02/2023CASH OUTCAH OUT VOUCHER NO 444465,000.00
8702/02/2023CASH OUTCAH OUT VOUCHER NO 444472,500.00
9802/02/2023CASH INCAH IN VOUCHER NO 122253,000.00
10902/02/2023CASH INCAH IN VOUCHER NO 122262,500.00
VOUCHER


ITEMS (1).xlsm
ABCDE
1ITEMDATETYPEDETAILESTOTAL
2101/02/2023CASH EXPENSESSERVICES EXPENSES5,000.00
3201/02/2023CASH EXPENSESFOOD EXPENSES1,200.00
4301/02/2023CASH EXPENSESTRANSPORTATION EXPENSES3,000.00
5402/02/2023CASH EXPENSESLABOR EXPENSES3,000.00
6503/02/2023CASH EXPENSESHIRE EXPENSES15,000.00
7604/02/2023CASH SALARY SALARY EXPENSES15,000.00
8705/02/2023CASH IN EMPLOYEECASH IN FROM EMPLOYEE2,000.00
9806/02/2023CASH OUT EMPLOYEECASH OUT TO EMPLOYEE3,000.00
10907/02/2023CASH IN EMPLOYEECASH IN FROM EMPLOYEE2,500.00
111008/03/2023CASH SALARY SALARY EXPENSES15,000.00
121109/03/2023ADVANCE PAYMENT OF SALARYADVANCE PAYMENT EXPENSES4,000.00
131210/03/2023ADVANCE PAYMENT OF SALARYADVANCE PAYMENT EXPENSES1,200.00
141311/03/2023CASH IN SAFECASH IN FROM REVENUE3,000.00
151412/03/2023CASH OUT SAFECASH OUT TO CUSTOMER5,500.00
161513/03/2023CASH IN SAFECASH IN FROM REVENUE10,000.00
171614/03/2023CASH OUT SAFECASH OUT TO CUSTOMER1,200.00
181715/03/2023EXTERNAL CASH DEPOSIT IN SAFECASH IN SAFE VN100003,000.00
191816/03/2023EXTERNAL CASH WITHDRAWAL FROM SAFECASH OUT SAFE N100015,000.00
201917/03/2023EXTERNAL CASH DEPOSIT IN SAFECASH IN SAFE VN100017,000.00
212018/03/2023EXTERNAL CASH WITHDRAWAL FROM SAFECASH OUT SAFE N100029,000.00
222119/03/2023SURPLUSE ADJUSTMENTCASH IN SAFE VN10002220.00
232220/03/2023SURPLUSE ADJUSTMENTCASH IN SAFE VN10003200.00
242321/03/2023SURPLUSE ADJUSTMENTCASH IN SAFE VN10004120.00
252422/03/2023DEFICIT ADJUSTMENTCASH OUT SAFE N10003200.00
262523/03/2023DEFICIT ADJUSTMENTCASH OUT SAFE N10004300.00
272624/03/2023CASH EXPENSESOTHERS EXPENSES VB122221,200.00
282725/03/2023CASH EXPENSESOTHERS EXPENSES VB122231,230.00
292826/03/2023EXTERNAL BANK DEPOSIT CASH IN BANK VN100042,000.00
302927/03/2023EXTERNAL CASH WITHDRAWALCASH OUT OUT N1000341,000.00
313028/03/2023EXTERNAL BANK DEPOSIT CASH IN BANK VN10001142,000.00
323129/03/2023EXTERNAL CASH WITHDRAWALCASH OUT BANK N1000131,000.00
CASH




before
ITEMS V3.xlsm
ABCDEFG
1MOVEMENTCASH INVOICESFORWARD INVOICESINVOICES TOTALCASH INCASH OUTEXPENSES
2PURCHASE
3PURCHASE RETURNS
4NET PURCHASE
5SALES
6SALES RETURNS
7NET SALES
8CASH IN
9CASH IN SAFE
10CASH OUT
11CASH EXPENSES
12CASH SALARY
13CASH OUT SAFE
14SURPLUSE ADJUSTMENT
15DEFICIT ADJUSTMENT
16ADVANCE PAYMENT OF SALARY
17CASH IN EMPLOYEE
18CASH OUT EMPLOYEE
19TOTAL EXPENSES
20EXTERNAL CASH DEPOSIT IN SAFE
21EXTERNAL CASH WITHDRAWAL FROM SAFE
22NET SAFE
23EXTERNAL BANK DEPOSIT
24EXTERNAL CASH WITHDRAWAL
25NET BANK
SAFE




result should be

ITEMS (1).xlsm
ABCDEFG
1MOVEMENTCASH INVOICESFORWARD INVOICESINVOICES TOTALCASH INCASH OUTEXPENSES
2PURCHASE263,000.0025,500.00288,500.00---
3PURCHASE RETURNS2,700.002,200.004,900.00---
4NET PURCHASE--283,600.00---
5SALES126,000.0024,000.00150,000.00---
6SALES RETURNS6,233.002,600.008,833.00---
7NET SALES--141,167.00---
8CASH IN---23,500.00--
9CASH IN SAFE---13,000.00--
10CASH OUT----13,500.00-
11CASH EXPENSES-----29,630.00
12CASH SALARY -----30,000.00
13CASH OUT SAFE----6,700.00-
14SURPLUSE ADJUSTMENT---540.00--
15DEFICIT ADJUSTMENT----500.00-
16ADVANCE PAYMENT OF SALARY-----5,200.00
17CASH IN EMPLOYEE---4,500.00--
18CASH OUT EMPLOYEE----3,000.00-
19TOTAL EXPENSES64,830.00-----
20EXTERNAL CASH DEPOSIT IN SAFE---10,000.00--
21EXTERNAL CASH WITHDRAWAL FROM SAFE----14,000.00-
22NET SAFE15,840.00-----
23EXTERNAL BANK DEPOSIT ---4,000.00--
24EXTERNAL CASH WITHDRAWAL----2,000.00-
25NET BANK2,000.00-----
SAFE



the calculation in some cells should be as highlighted cell
ITEMS (1).xlsm
ABCDEFG
1MOVEMENTCASH INVOICESFORWARD INVOICESINVOICES TOTALCASH INCASH OUTEXPENSES
2PURCHASE263,000.0025,500.00288,500.00---
3PURCHASE RETURNS2,700.002,200.004,900.00---
4NET PURCHASE--283,600.00---
5SALES126,000.0024,000.00150,000.00---
6SALES RETURNS6,233.002,600.008,833.00---
7NET SALES--141,167.00---
8CASH IN---23,500.00--
9CASH IN SAFE---13,000.00--
10CASH OUT----13,500.00-
11CASH EXPENSES-----29,630.00
12CASH SALARY -----30,000.00
13CASH OUT SAFE----6,700.00-
14SURPLUSE ADJUSTMENT---540.00--
15DEFICIT ADJUSTMENT----500.00-
16ADVANCE PAYMENT OF SALARY-----5,200.00
17CASH IN EMPLOYEE---4,500.00--
18CASH OUT EMPLOYEE----3,000.00-
19TOTAL EXPENSES64,830.00-----
20EXTERNAL CASH DEPOSIT IN SAFE---10,000.00--
21EXTERNAL CASH WITHDRAWAL FROM SAFE----14,000.00-
22NET SAFE15,840.00-----
23EXTERNAL BANK DEPOSIT ---4,000.00--
24EXTERNAL CASH WITHDRAWAL----2,000.00-
25NET BANK2,000.00-----
SAFE
Cell Formulas
RangeFormula
D5:D6,D2:D3D2=B2+C2
D4,D7D4=D2-D3
B19B19=G11+G12+G16
B22B22=(E8+E9+E14+E17+E20+E23)-(F10+F13+F15+F18+F21+F24)
B25B25=E23-F24



here is sample simple file to see close, hope there is no error in my details , if it's so please inform me to correcting.
Dropbox
 
Last edited:

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,224,813
Messages
6,181,111
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