sort & insert TOTAL row and BALANCE column together for duplicates items

Maklil

Board Regular
Joined
Jun 23, 2022
Messages
149
Office Version
  1. 2019
Platform
  1. Windows
Hi
I want sort data from sheet1 to sheet2 based on column E . the column BALANCE should subtract column F from column G and the row TOTAL shoud summing values in columns F,G with considering also subtract column F from column G for each TOTAL row in column BALANCE and should show hyphen for any cell is empty or contain zero .
Microsoft Excel (2).xlsx
ABCDEFG
1DATEINVOICE NOMADEDEL.NOBRANDIMPORTEXPORT
21/1/2021INV1000CHIGGOD2ELEC-1000200
31/2/2021INV1000TURGGOD3ELEC-10011200
41/3/2021INV1000ITGGOD4ELEC-1002122
51/4/2021INV1001VITGGOD5ELEC-10031200
61/5/2021INV1002CHIGGOD6ELEC-1004120
71/6/2021INV1003TURGGOD7ELEC-1005300
81/7/2021INV1001ITGGOD8ELEC-1006230
91/8/2021INV1002VITGGOD9ELEC-1007123
101/9/2021INV1003CHIGGOD10ELEC-1008123
111/10/2021INV1004CHIGGOD11ELEC-1000123
121/11/2021INV1004TURGGOD12ELEC-10011122
131/12/2021INV1004ITGGOD13ELEC-100012210
141/13/2021INV1004VITGGOD14ELEC-10014
151/14/2021INV1005CHIGGOD15ELEC-1007123
161/15/2021INV1006TURGGOD16ELEC-10081231
171/16/2021INV1007ITGGOD17ELEC-100911
181/17/2021INV1008VITGGOD18ELEC-101011
191/18/2021INV1009CHIGGOD19ELEC-101112
201/19/2021INV1010TURGGOD20ELEC-101212
211/20/2021INV1011ITGGOD21ELEC-10131012
SHEET1


result
ورقة عمل Microsoft Excel جديد (2).xlsx
ABCDEFGH
1ITEMINVOICE NOMADEDEL.NOBRANDIMPORTEXPORTBALANCE
21INV1000CHIGGOD2ELEC-1000200.00-200.00
32INV1004CHIGGOD11ELEC-1000123.00-123.00
43INV1004ITGGOD13ELEC-1000122.0010.00112.00
5TOTAL445.0010.00435.00
61INV1000TURGGOD3ELEC-10011,200.00-1,200.00
72INV1004TURGGOD12ELEC-10011,122.00-1,122.00
83INV1004VITGGOD14ELEC-1001-4.00-4.00
9TOTAL2,322.004.002,318.00
101INV1000ITGGOD4ELEC-1002-122.00-122.00
11TOTAL-122.00-122.00
121INV1001VITGGOD5ELEC-10031,200.00-1,200.00
13TOTAL1,200.00-1,200.00
141INV1002CHIGGOD6ELEC-1004120.00-120.00
15TOTAL120.00-120.00
161INV1003TURGGOD7ELEC-1005300.00-300.00
17TOTAL300.00-300.00
181INV1001ITGGOD8ELEC-1006230.00--
19TOTAL230.00-230.00
201INV1002VITGGOD9ELEC-1007123.00-123.00
212INV1005CHIGGOD15ELEC-1007123.00-123.00
22TOTAL246.00-246.00
231INV1003CHIGGOD10ELEC-1008123.00-123.00
242INV1006TURGGOD16ELEC-1008123.001.00122.00
25TOTAL246.001.00245.00
261INV1008VITGGOD18ELEC-101011.00-11.00
27TOTAL11.00-11.00
281INV1009CHIGGOD19ELEC-101112.00-12.00
29TOTAL12.00-12.00
301INV1010TURGGOD20ELEC-101212.00-12.00
31TOTAL12.00-12.00
321INV1011ITGGOD21ELEC-101310.0012.00-2.00
33TOTAL12.00-12.00
sheet2

thanks
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,215,409
Messages
6,124,733
Members
449,185
Latest member
hopkinsr

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