How can I return the most recent account balance from a chart of multiple accounts

Lyryx

New Member
Joined
Aug 18, 2015
Messages
45
Hi everyone,

I thought this issue would be simple but it's actually proving to be quite difficult.


I need to write a formula that will return the last balance for an account within a table of multiple accounts.
Essentially the formula needs to look at the MAX date for all transactions impacting one account within my chart of accounts. Then look at it's ending running total balance and return it.



I've tried using the following formula:

Code:
=INDEX(Master[Validation],MATCH(MAXIFS(Master[Transaction Date],Master[Account '#],A31),Master[Transaction Date],0))

Where;

Master = The name of my master table
Validation = the running total column - where the figure I'd like to return resides
Transaction Date = Transaction Date - where the maximum date needs to be pulled from
Account '# = Account Number - the criteria used to distinguish which validation amount should be taken.
A31 (Column A) = the list of accounts that make up the criteria to be searched for within my master.​

The issue with this current formula is that it will look up the max date for an account but then return the first balance in the validation column that matches the date.

So even though the max date being picked up from the Nested MAXIFs function is correct. Any validation balance that matches that date can be returned, when I need it to only return a balance that matches the account number in question.



I've been wracking my brain on this one trying to use various forms of Array, Index and Lookup functions. So I'd appreciate any assistance one could provide.

Thank you.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
One way

Excel 2016 (Windows) 32 bit
[Table="width:, class:head"][tr=bgcolor:#E0E0F0][th] [/th][th]
A
[/th][th]
B
[/th][th]
C
[/th][th]
D
[/th][th]
E
[/th][th]
F
[/th][th]
G
[/th][th]
H
[/th][/tr]
[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
1
[/td][td=bgcolor:#4472C4]Transaction Date[/td][td=bgcolor:#4472C4]Account[/td][td=bgcolor:#4472C4]Validation[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
2
[/td][td=bgcolor:#D9E1F2]
20/08/2019​
[/td][td=bgcolor:#D9E1F2]AC1[/td][td=bgcolor:#D9E1F2]
773.04​
[/td][td][/td][td][/td][td]AC1[/td][td]
681.01​
[/td][td]{=INDEX(Master[Validation],MATCH(F2&MAXIFS(Master[Transaction Date],Master[Account],F2),Master[Account]&Master[Transaction Date],0))}[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
3
[/td][td]
22/08/2019​
[/td][td]AC1[/td][td]
959.70​
[/td][td][/td][td][/td][td]AC2[/td][td]
240.09​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
4
[/td][td=bgcolor:#D9E1F2]
23/08/2019​
[/td][td=bgcolor:#D9E1F2]AC1[/td][td=bgcolor:#D9E1F2]
985.63​
[/td][td][/td][td][/td][td]AC3[/td][td]
626.02​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
5
[/td][td]
29/08/2019​
[/td][td]AC1[/td][td]
316.05​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
6
[/td][td=bgcolor:#D9E1F2]
31/08/2019​
[/td][td=bgcolor:#D9E1F2]AC1[/td][td=bgcolor:#D9E1F2]
263.46​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
7
[/td][td]
07/09/2019​
[/td][td]AC1[/td][td]
681.01​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
8
[/td][td=bgcolor:#D9E1F2]
23/08/2019​
[/td][td=bgcolor:#D9E1F2]AC2[/td][td=bgcolor:#D9E1F2]
207.78​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
9
[/td][td]
24/08/2019​
[/td][td]AC2[/td][td]
971.50​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
10
[/td][td=bgcolor:#D9E1F2]
26/08/2019​
[/td][td=bgcolor:#D9E1F2]AC2[/td][td=bgcolor:#D9E1F2]
430.09​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
11
[/td][td]
27/08/2019​
[/td][td]AC2[/td][td]
459.85​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
12
[/td][td=bgcolor:#D9E1F2]
01/09/2019​
[/td][td=bgcolor:#D9E1F2]AC2[/td][td=bgcolor:#D9E1F2]
107.55​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
13
[/td][td]
03/09/2019​
[/td][td]AC2[/td][td]
240.09​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
14
[/td][td=bgcolor:#D9E1F2]
24/08/2019​
[/td][td=bgcolor:#D9E1F2]AC3[/td][td=bgcolor:#D9E1F2]
210.40​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
15
[/td][td]
26/08/2019​
[/td][td]AC3[/td][td]
429.55​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
16
[/td][td=bgcolor:#D9E1F2]
27/08/2019​
[/td][td=bgcolor:#D9E1F2]AC3[/td][td=bgcolor:#D9E1F2]
285.10​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
17
[/td][td]
31/08/2019​
[/td][td]AC3[/td][td]
711.98​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
18
[/td][td=bgcolor:#D9E1F2]
02/09/2019​
[/td][td=bgcolor:#D9E1F2]AC3[/td][td=bgcolor:#D9E1F2]
589.78​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
19
[/td][td]
04/09/2019​
[/td][td]AC3[/td][td]
779.40​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
20
[/td][td=bgcolor:#D9E1F2]
06/09/2019​
[/td][td=bgcolor:#D9E1F2]AC3[/td][td=bgcolor:#D9E1F2]
626.02​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[/table]
[Table="width:, class:grid"][tr][td]Sheet: Sheet1[/td][/tr][/table]

ARRAY FORMULA in G2 - must be committed with {CTRL}{SHIFT}{ENTER}
=INDEX(Master[Validation],MATCH(F2&MAXIFS(Master[Transaction Date],Master[Account],F2),Master[Account]&Master[Transaction Date],0))

Entered as array is automatically enclosed in { }
{=INDEX(Master[Validation],MATCH(F2&MAXIFS(Master[Transaction Date],Master[Account],F2),Master[Account]&Master[Transaction Date],0))}
 
Upvote 0
Or,

In G2, regular formula copied down :

=LOOKUP(9^9,Master[Validation]/(Master[Account]=F2)/(Master[Transaction Date]<>""))

Reagrds
 
Upvote 0

Forum statistics

Threads
1,223,775
Messages
6,174,458
Members
452,566
Latest member
Bonnie_bb

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