last number in column

Heyjoe
05-22-2008, 05:16 AM
I have a workbook with a number of worksheets. In column d of each worksheet will be the balance of each account. I want to get a sum of all of these balances. The balances could be on any row in column d. Is there a function I can use to get the last number in column d, or do I need to use code?

Timbo
05-22-2008, 05:39 AM
Yes, you can use 'COUNTA' to tell you how many populated cells there are in your column, and 'OFFSET' to return the value from another cell. Look those up in your Excel help :)

Heyjoe
05-22-2008, 08:17 PM
I tried using counta and offset together. This did not give me the last value in the column like I am trying to do.

Cas
05-22-2008, 08:36 PM
This thread (http://www.xtremevbtalk.com/showthread.php?t=296693) discusses several methods of finding the last non-blank cell/value in a column.

Colin Legg
05-23-2008, 02:22 AM
I have a workbook with a number of worksheets. In column d of each worksheet will be the balance of each account. I want to get a sum of all of these balances. The balances could be on any row in column d. Is there a function I can use to get the last number in column d, or do I need to use code?

Non-programmatically, there are various ways to return the last populated cell in a column. Typically these formulas are used in named ranges (ie Dynamic Named Range). The complexity of these formulas will vary depending on the type and variety of data within the column.

However, if your aim is to create a "3-D" Dynamic Range then you're going to find you can't do it (I'm alluding to your question on this post (http://www.xtremevbtalk.com/showthread.php?t=296779)).

There are quite a few examples of dynamic named ranges here:
http://www.ozgrid.com/Excel/DynamicRanges.htm

Depending on how flexible you want things to be and on how many worksheets you're going to be working on, you might be better off using VBA, yes.

I tried using counta and offset together. This did not give me the last value in the column like I am trying to do.
Hard to say what the problem is without seeing your formula and the data. Check out the examples on the link I gave.

HTH
Colin

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum