LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

An example:

On Sheet1 you have a table, p.e. in columns A:H, with headers in row1.
Column A is a key column, i.e. whenever there are data on row, the cell in
column A is not empty. And there never are gaps (empty rows) in your table.

You can define dynamic named ranges:
from menu select Insert.Name.Define;
in Names field determine a name for range;
in Refers To field, enter value, reference or formula returning a value or
cell reference;
OK.

Now, for our example, define named ranges p.e.
MyTable=OFFSET(Sheet1!$A$2,,,COUNTIF(Sheet1!$A:$A, "<")-1,9)
MyKey=OFFSET(Sheet1!$A$2,,,COUNTIF(Sheet1!$A:$A,"< ")-1,1)
MyValue=OFFSET(Sheet1!$F$2,,,COUNTIF(Sheet1!$A:$A, "<")-1,1)

When you add or remove rows in your table, those ranges will always adjust
automatically, the range MyTable returns the range Sheet1!A2:Hx, MyKey
returns the range Sheet1!A2:Ax and MyValue returns the range Sheet1!F2:Fx,
where x is the number of last filled row in table. (Here is demonstrated one
way to define dynamic ranges, but depending on your table design and your
goals, there are possible other definitions too)

Now, whenever you p.e. want:
a) to count the nimber of filled rows in table
=COUNTA(MyKey)
b) to sum all values in MyValue where MyKey=z
=COUNTIF(MyKey,x,MyValue)
to return a value from column H from row where MyKey=z
=VLOOKUP(z,MyTable,9,0)
etc.

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


"jjpcpanama" wrote in message
...
thanks for the reply, but i don't understand the response. I don't know

what
to put in (your range). i created a column to number the rows as i was
regularly adding rows and deleting rows and the formula that utilized the
number of rows had to be updated/changed by hand. This bugged me. I

called
the column "number"

"Arvi Laanemets" wrote:

Hi

Define the datarange in column as dynamic range - so it'll adjust

himself
whenever you enter new rows of data into table. Then your formula will

be
simply
=SUM(YourRange)

How to define a dynamic named range, depends on design of your worksheet
(from where your data start, have you header row(s), are there some

other
fixed entries in same column, have you empty cells included into

datarange,
are your data values numeric or text, are there values or formulas in
datarange, etc.), and how you plan to use this named range in formulas

(do
you refer always to whole datarange, or depends the referred range on
position of cell with formula, etc.) - so for any useful advice more
detailed explanations must be given.

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


"jjpcpanama" wrote in message
...
I add and subtract rows of data each week. One of the simple formulas
includes how many rows there are. How do I include the row number in

a
formula? =SUM(F24/22) 22 refers to the first column which is a row

counter
which contains 1,2,3,4,5,6..etc as I don't know how to enter a row

counter
in
the formula that is automatically updated as I add or delete rows.






 
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
IF & VLOOKUP FORMULA taxmom Excel Worksheet Functions 3 March 2nd 05 03:35 PM
Match / Vlookup within an Array formula Hari Prasadh Excel Discussion (Misc queries) 3 February 3rd 05 04:37 PM
revert formula insertion to old method Don't be a pain in the ass Setting up and Configuration of Excel 0 January 24th 05 01:49 PM
Help with macro formula and variable Huge project Excel Worksheet Functions 0 December 28th 04 01:27 AM
Cell doesn't show formula result - it shows formula (CTRL + ' doe. o0o0o0o Excel Worksheet Functions 6 November 19th 04 03:13 PM


All times are GMT +1. The time now is 10:21 PM.

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

About Us

"It's about Microsoft Excel"