Lookup last date and return with result

DHayes

Board Regular
Joined
Nov 12, 2014
Messages
244
Good day,
I am struggling to put a formula together. I need to get the opening and closing from sheet1 (Below) and put it into sheet2. I need the balance from the last date but not later 2015-03-31. Some accounts the last date is in 2014. I need to do this for +- 23000 accounts. any assistance will be appreciated.

Invoice_DateAccount_NoOpening_BalanceCurrent_Balance
2014-01-16100137/000239208.62418.90
2014-02-17100137/000239418.90630.80
2014-03-18100137/000239630.83208.60
2014-04-16100137/000239208.62418.90
2014-05-19100137/000239418.90630.80
2014-06-25100137/000239630.83844.40
2014-07-29100137/000239844.401989.00
2014-08-24100137/0002391989.023136.10
2014-09-18100137/0002393136.114300.70
2014-10-20100137/0002394300.7011845.20
2014-11-17100137/00023911845.2112173.60
2014-12-17100137/00023912173.6312504.00
2015-01-20100137/00023912504.0012836.30
2015-02-17100137/00023912836.3213170.55
2015-03-19100137/00023913170.5913506.75
2015-04-19100137/00023913506.7913844.90
2015-05-18100137/00023913844.944174.75
2015-06-28100137/0002394174.765346.00
2015-07-24100137/0002395346.046550.05
2015-08-19100137/0002396550.057765.25
2015-09-20100137/0002397765.258990.60

<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
If the data is always in chronological order and the last transaction is in the final row; and there is only one account per tab then this will work: =LOOKUP(2,1/(A:A<>""),C:C)
Change C:C to D:D for the Current Balance.
 
Upvote 0
Just noticed your restriction " but not later 2015-03-31." so my formula will not work.

This should do the trick:
=LOOKUP(42094,A:A,C:C)
You could change the 42094 to a cell reference that had the max date in it.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,958
Members
449,096
Latest member
Anshu121

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