copy amount from last row to above cell for adjacent cell into adjacent column

Mussala

Board Regular
Joined
Sep 28, 2022
Messages
74
Office Version
  1. 2019
Platform
  1. Windows
Hi
I would copy the amount from lastrow(TOTAL) in column E and put above cell in column F for two sheets.

MOVED with code.xlsm
ABCDEF
1DATEITEMIMPORTEXPORTBALANCEREAL
215/06/2023ITFG-0012,000.002,000.00
315/06/2023ITFG-0022,200.001,000.001,200.00
415/06/2023ITFG-0032,400.002,000.00400.00
515/06/2023ITFG-0042,600.002,600.00
6TOTAL9,200.003,000.006,200.00
716/06/2023ITFG-0052,800.002,800.00
816/06/2023ITFG-0063,000.001,200.001,800.00
916/06/2023ITFG-0073,200.00200.003,000.00
1016/06/2023ITFG-0083,400.00200.003,200.00
11TOTAL12,400.001,600.0010,800.00
1217/06/2023ITFG-0093,600.00500.003,100.00
13TOTAL3,600.00500.003,100.00
1418/06/2023ITFG-0103,800.003,800.00
15TOTAL3,800.000.003,800.00
1619/06/2023ITFG-0114,000.00500.003,500.00
1719/06/2023ITFG-0124,200.00600.003,600.00
1819/06/2023ITFG-0134,400.00700.003,700.00
1919/06/2023ITFG-0144,600.004,600.00
2019/06/2023ITFG-0154,800.004,800.00
2119/06/2023ITFG-0165,000.00100.004,900.00
2219/06/2023ITFG-0175,200.005,200.00
23TOTAL32,200.001,900.0030,300.00
2420/06/2023ITFG-0175,200.005,200.00
25TOTAL5,200.000.005200
SV
Cell Formulas
RangeFormula
C6:E6C6=SUBTOTAL(9,C$2:C5)
C11:E11C11=SUBTOTAL(9,C$7:C10)
C13:E13C13=SUBTOTAL(9,C$12:C12)
C15:E15C15=SUBTOTAL(9,C$14:C14)
C23:E23C23=SUBTOTAL(9,C$16:C22)
E24,E16:E22,E14,E12,E7:E10,E2:E5E2=C2-D2
C25:E25C25=SUBTOTAL(9,C$24:C24)



MOVED with code.xlsm
ABCDEF
1DATEITEMIMPORTEXPORTBALANCEREAL
219/06/2023ITFG-0012,000.002,000.00
319/06/2023ITFG-0022,200.001,000.001,200.00
419/06/2023ITFG-0032,400.002,000.00400.00
519/06/2023ITFG-0042,600.002,600.00
6TOTAL9,200.003,000.006,200.00
mm
Cell Formulas
RangeFormula
E2:E6E2=C2-D2
C6:D6C6=SUM(C2:C5)




result

MOVED with code.xlsm
ABCDEF
1DATEITEMIMPORTEXPORTBALANCEREAL
215/06/2023ITFG-0012,000.002,000.00
315/06/2023ITFG-0022,200.001,000.001,200.00
415/06/2023ITFG-0032,400.002,000.00400.00
515/06/2023ITFG-0042,600.002,600.006,200.00
6TOTAL9,200.003,000.006,200.00
716/06/2023ITFG-0052,800.002,800.00
816/06/2023ITFG-0063,000.001,200.001,800.00
916/06/2023ITFG-0073,200.00200.003,000.00
1016/06/2023ITFG-0083,400.00200.003,200.0010,800.00
11TOTAL12,400.001,600.0010,800.00
1217/06/2023ITFG-0093,600.00500.003,100.003,100.00
13TOTAL3,600.00500.003,100.00
1418/06/2023ITFG-0103,800.003,800.003,800.00
15TOTAL3,800.000.003,800.00
1619/06/2023ITFG-0114,000.00500.003,500.00
1719/06/2023ITFG-0124,200.00600.003,600.00
1819/06/2023ITFG-0134,400.00700.003,700.00
1919/06/2023ITFG-0144,600.004,600.00
2019/06/2023ITFG-0154,800.004,800.00
2119/06/2023ITFG-0165,000.00100.004,900.00
2219/06/2023ITFG-0175,200.005,200.0030,300.00
23TOTAL32,200.001,900.0030,300.00
2420/06/2023ITFG-0175,200.005,200.005,200.00
25TOTAL5,200.000.005200
SV
Cell Formulas
RangeFormula
C6:E6C6=SUBTOTAL(9,C$2:C5)
C11:E11C11=SUBTOTAL(9,C$7:C10)
C13:E13C13=SUBTOTAL(9,C$12:C12)
C15:E15C15=SUBTOTAL(9,C$14:C14)
C23:E23C23=SUBTOTAL(9,C$16:C22)
E24,E16:E22,E14,E12,E7:E10,E2:E5E2=C2-D2
C25:E25C25=SUBTOTAL(9,C$24:C24)




MOVED with code.xlsm
ABCDEF
1DATEITEMIMPORTEXPORTBALANCEREAL
219/06/2023ITFG-0012,000.002,000.00
319/06/2023ITFG-0022,200.001,000.001,200.00
419/06/2023ITFG-0032,400.002,000.00400.00
519/06/2023ITFG-0042,600.002,600.006,200.00
6TOTAL9,200.003,000.006,200.00
mm
Cell Formulas
RangeFormula
E2:E6E2=C2-D2
C6:D6C6=SUM(C2:C5)


with considering the TOTAL row will change in location for MM sheet .
just copy to TOTAL row precedes .

thanks.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Is this what you need? See formula in F2, copied down.

Book1
ABCDEF
1DATEITEMIMPORTEXPORTBALANCEREAL
215/06/2023ITFG-00120002000 
315/06/2023ITFG-002220010001200 
415/06/2023ITFG-00324002000400 
515/06/2023ITFG-004260026006200
6TOTAL920030006200 
716/06/2023ITFG-00528002800 
816/06/2023ITFG-006300012001800 
916/06/2023ITFG-00732002003000 
1016/06/2023ITFG-0083400200320010800
11TOTAL12400160010800 
1217/06/2023ITFG-009360050031003100
13TOTAL36005003100 
1418/06/2023ITFG-010380038003800
15TOTAL380003800 
1619/06/2023ITFG-01140005003500 
1719/06/2023ITFG-01242006003600 
1819/06/2023ITFG-01344007003700 
1919/06/2023ITFG-01446004600 
2019/06/2023ITFG-01548004800 
2119/06/2023ITFG-01650001004900 
2219/06/2023ITFG-0175200520030300
23TOTAL32200190030300 
2420/06/2023ITFG-017520052005200
25TOTAL520005200 
Sheet1
Cell Formulas
RangeFormula
E2:E5,E7:E10,E12,E14,E16:E22,E24E2=C2-D2
F2:F25F2=IF(A3="TOTAL",E3,"")
C6:E6E6=SUBTOTAL(9,E$2:E5)
C11:E11E11=SUBTOTAL(9,E$7:E10)
C13:E13E13=SUBTOTAL(9,E$12:E12)
C15:E15E15=SUBTOTAL(9,E$14:E14)
C23:E23E23=SUBTOTAL(9,E$16:E22)
C25:E25C25=SUBTOTAL(9,C$24:C24)
 
Upvote 0
Solution
Impressive !
I expected doing by vba . formula is small chance to do that.;)
thank you so much .:)
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,141
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