The ADDRESS Function returns a cell reference in text form like "A1" based on a specified row and column position that you give it. Very useful in constructing formulas that adapt to changing data.
The ADDRESS function is a computer program that you run from a worksheet cell formula. It returns a cell reference in text form like "A1" based on a specified row and column position that you give it. ADDRESS is used when you have a set of row and column positions and you need to translate this into a cell reference. This need arises many times when you are developing formulas that count data rows or columns on the worksheet or that are searching for something on the worksheet like text, numbers or dates down a column or across a row. The formulas calculating these values usually generate numbers like row or column position not a cell address. So you need some function to convert those numbers into valid cell references so you can then use them as inputs to formulas or functions like the SUM function.
Once the cell reference text is generated by the ADDRESS function, the ADDRESS worksheet function is used with the INDIRECT function being nested inside it as an argument. The INDIRECT function takes the reference text that ADDRESS produces and changes it to a valid reference. Remember ADDRESS only produces text which is not a valid cell reference. You must use INDEX to flip it. The ADDRESS function is key to building range or cell references on the fly (i.e. during calculation). This has many advantages because if your formulas are smart enough to changing worksheet conditions, it eliminates you having to constantly change the references in your formulas if cell positions shift or data changes size on the worksheet. The ADDRESS function is commonly used with the & operator in a formula to help splice together range references that can be used as arguments for functions like SUM or VLOOKUP. The & operator is a formula operator that performs string concatenation (i.e. splice values together).
Whenever you type a formula in a worksheet cell, this is called syntax or grammar. The general ADDRESS function syntax has a format like this when you type it in a worksheet cell:
=ADDRESS(row_num, column_num, [abs_num], [a1], [sheet_text])
Where row_num, column_num, [abs_num], [a1], [sheet_text] are called the function argument list. Remember, you are running a computer program at this point so the program needs information to operate and that is why there is an argument list. When you see an argument list and you see square brackets [ ] around the argument name, this means the argument is optional and you do not have to include it when typing unless you need it. So for the syntax above, you need to include 2 arguments for the ADDRESS worksheet function when typing it in a worksheet cell formula in order for it to calculate correctly. What argument values can be used are discussed below. Remember functions expect certain things in their argument lists, if you do not put the correct information in the list they will generate an error when run.
|1 or omitted||Absolute cell reference returned|
|2||Absolute row; relative column cell reference returned|
|3||Relative row; absolute column cell reference returned|
Since the ADDRESS function is a computer program, it runs when you press Enter to enter the formula that contains it. If any of the arguments are wrong, the function will return an error.
When typing the ADDRESS function in a worksheet cell formula, you need to replace the argument list with arguments separating each one with a comma (,). Some typical arguments you can use are:
|Argument Type||Cell Formula||Explanation|
|Number Constants||= ADDRESS( 1,1 )||Returns the cell reference $A$1 in absolute reference. This does not do anything because it is a piece of text not a cell reference that returns a value.|
|Cell References and Formulas||= ADDRESS( A1, B1+2 )||Returns the cell reference specified by the numbers generated by A1 and B1+2. This does not do anything because it is a piece of text not a cell reference that returns a value.|
|Nested Functions||= INDIRECT( ADDRESS( 1, 1 ) )||Returns the value in cell $A$1. ADDRESS is used to create the cell reference text and INDIRECT flips it to a valid cell reference.|
* This function is used a great deal in building adaptive formulas that figure out ranges, start and stop of data.... It is also heavily used in dashboard design tying numeric ActiveX control outputs into formulas that seek out data in tables.
The worksheet seen below contains some typical worksheet formulas that run the ADDRESS worksheet function. Pay close attention to the argument list and the syntax used to write the formula.
|2||100||=SUM( INDIRECT( ADDRESS( 1, 1 ) & ":" & ADDRESS( COUNTA(A1:A100), 1 ) ) )||Sums the values between cells A1 and A7 on the worksheet which is 2100. ADDRESS is used to create the range reference text, INDIRECT flips it to a valid range reference before SUM uses it as an argument. COUNTA figures out how many occupied cells are in the A1 to A100 range thus providing the end row number of the data. The & is used to splice everything together to form a range reference.|
|11||=SUM( INDIRECT( ADDRESS( 8,MATCH("Q1",8:8,0) ) & ":" & ADDRESS( 10, MATCH( "Q1", 8:8, 0 ) ) ) )||Sums the values between cells rows 8 and 10 on the worksheet for Q1 which is 3000. ADDRESS is used to create the range reference text, INDIRECT flips it to a valid range reference before SUM uses it as an argument. MATCH figures out the column position for the range reference. The & is used to splice everything together to form a range reference.|