The following formula will always return the value of the 4th column (D) of the next row.
=INDIRECT("R[1]C[" & 4-COLUMN() & "]",FALSE)
Is there a better way to achieve the same results?
The following formula will always return the value of the 4th column (D) of the next row.
=INDIRECT("R[1]C[" & 4-COLUMN() & "]",FALSE)
Is there a better way to achieve the same results?
Similar, but less wordy and easier to read (IMHO), is the A1 style of addressing:
=INDIRECT("$D" & ROW()+1)
Putting a $ character in front of a column letter or row number will lock it down when you copy and paste.
Eg:
$C$17
Depends what you mean by better :-)
If you mean shorter/simpler and A1 style, then shoover s answer is fine:
=INDIRECT("$D"&ROW()+1)
If you prefer R1C1 style (easier to read IMHO ;-) ) then an even shorter/simpler/faster solution is:
=INDIRECT("R[1]C4",)
However, if you re after the fastest solution, or just simply prefer a non-volatile one, then a Named Formula is the way to go:
Define a Name, say Col4Down1
, and set its value to:
=INDEX(!$D:$D,ROW()+1)
Place the following formula in a cell to get the desired result:
=Col4Down1
This works because of a little known quirk when using the bang operator !
in a Named Formula. When you don t specify a sheetname, !$D:$D
always refers to the fourth column irrespective of column deletions/insertions. Think of it as absolute-absolute addressing.
Finally, Lance Roberts answer, whilst being non-volatile, suffers from a couple of problems. As he mentions, it will only work in certain, predetermined, rows. Secondly, insertion/deletion of any columns from A-D, or of any rows above, will break it. Modifying it to fix these leads to the following (if entered into cell B2):
=INDEX(B:B:2:2,ROW()+1,4)
or if you prefer R1C1 style and have set your spreadsheet to use this style:
=INDEX(R:C,ROW()+1,4)
This will work if you know the range:
=INDEX($A$1:$E$4, ROW()+1, 4)
For an Excel formula I need the first cell out of a list of cells which contains a numeric value: A | B | C | ... | Z | ----------------------------- | 0.1 | 0.4 | ... | =0.1 | | ...
I have a stored procedure that imports differently formatted workbooks into a database table, does work on them then drops the table. Here is the populating query. SELECT IDENTITY(INT,1,1) AS ID ...
The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...
I m using Application run to call several macros in order like this. Sub Run_All_Macros() Application.Run ("Macro_1") Application.Run ("Macro_1") End Sub When I start Run_All_Macros, all the ...
Does anyone know how to convert an Excel date to a correct Unix timestamp?
I am trying to import an excel file into a data table using GemBox and I keep getting this error: Invalid data value when extracting to DataTable at SourceRowIndex: 1, and SourceColumnIndex: 1. As ...
I am looking for any tips or resources on importing from excel into a SQL database, but specifically when the information is NOT in column and row format. I am currently doing some pre-development ...
I have created an Add-In in C# that implements user defined functions for Excel. These UDF s return immediately, but they control background asynchronous procedures. These procedures have status ...