Populate Balance in last row based on sheet name

Mussala

Board Regular
Joined
Sep 28, 2022
Messages
61
Office Version
  1. 2019
Platform
  1. Windows
Hello
I want populating balance in cell I4 based on cell G4 in VOUCH sheet . the cell G4 should match based on sheet name .
if the sheet name is wrong in G4 then doesn't populate balance . when populate balance should be based on last row for column E
BL.xlsm
ABCDE
1DATEACCOUNTDEBITCREDITBALANCE
201/01/2021SALES S0042,000.002,000.00
302/01/2021PUR A0031,000.002,000.001,000.00
403/01/2021PUR A0041,200.003,000.00-800.00
504/01/2021SALES S0042,000.001,200.00
605/01/2021SALES S0052,300.003,500.00
706/01/2021SALES S0066,000.00100.009,400.00
807/01/2021SALES S0071,400.0010,800.00
MUSSA
Cell Formulas
RangeFormula
E2E2=C2-D2
E3:E8E3=E2+C3-D3


BL.xlsm
GHI
3SHEET NAMEAMOUNT
4
vouch


expected
BL.xlsm
GHI
3SHEET NAMEAMOUNT
4MUSSA10,800.00
vouch
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Try this formula in cell I4 of your "vouch" sheet:
Excel Formula:
=INDEX(INDIRECT(G4&"!E:E"),COUNTA(INDIRECT(G4&"!E:E")))
or this one:
Excel Formula:
=LOOKUP(2,1/(INDIRECT(G4&"!E:E")<>""),INDIRECT(G4&"!E:E"))
 
Upvote 1
Solution
I 'm surprised from the formula !
I expected just one way by vba , but the formula is very great .
many thanks for your help .:)
 
Upvote 0
You are welcome!
Glad we were able to help!
 
Upvote 0

Forum statistics

Threads
1,215,174
Messages
6,123,454
Members
449,100
Latest member
sktz

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