LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Referring to last row with data in it

I could write a VBA macro to do this, but I'm hoping there is a
simpler method.

I've got a spreadsheet with several bank statements in it. Column A
of each sheet with a bank statement is dates, column C is the account
balance.

On the cover page I've got a summary table with hyperlinks to each of
the respective bank accounts, I've got something close to what I want
by using formulae similar to the following

=VLOOKUP(MAX('ANZ Bank Statement'!A:A),'ANZ Bank Statement'!A:C,
3,FALSE)

i.e. look up the value in the third row which is next to the latest
date.

Works fine if the latest day has only a single transaction, but if
there were several transactions that day it will show the first of the
final day's transactions, not the last of the final day's
transactions, so my formula doesn't necessarily show the latest value
of the bank account.

I spent a bit of time yesterday writing a complex looping macro for a
different problem before realising that I could achieve the same
result by using Excel 2007's SUMIFS function. This was good because
it meant the table would auto update without having to run a macro or
set a resource-hogging "on change" event trigger or something.

But I'm trying to figure out how to get it to always refer to the last
of the rows.

The following SUMIFS will add up all the values on the last date,
which isn't what I want. I could add a second condition though, how
would I specify "and if the value in the following row is blank" or
some equivalent condition?

=SUMIFS('ANZ Bank Statement'!C:C,'ANZ Bank Statement'!A:A,MAX('ANZ
Bank Statement'!A:A))

Travis
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Referring to data series in a chart keri Excel Programming 1 January 9th 07 02:53 AM
Referring to external workbook in Data Validation aposatsk Excel Discussion (Misc queries) 2 August 21st 06 04:24 PM
referring to other worksheet Geetu M Excel Worksheet Functions 2 March 29th 05 09:37 PM
Pivot Tables referring to external data query Excel GuRu Excel Discussion (Misc queries) 4 December 29th 04 06:29 PM
Referring Date in VBA anupam[_3_] Excel Programming 1 August 26th 04 01:10 PM


All times are GMT +1. The time now is 03:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"