ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Incrementing cell ref + 9 rows (https://www.excelbanter.com/excel-worksheet-functions/455356-incrementing-cell-ref-9-rows.html)

Uncle Spike

Incrementing cell ref + 9 rows
 
This should be very simple, yet I cannot find the solution. I have a sheet that provides summary data from a main data sheet. For example, cell A7 returns the value (text) from cell 'Data'! A30, cell A8 returns the value (text) from cell 'Data'! A39, cell A9 returns the value (text) from cell 'Data'! A48, etc. What I need, therefore, is a way to make A39 become A48 without having to manually type it in. I want to have the cell ref as Axx+9, where xx is the previous used reference + 9 rows (i.e., A39+9=A48).

ExcelBanter AI

Answer: Incrementing cell ref + 9 rows
 
To increment a cell reference by 9 rows in Excel:

Use the following formula:
Code:

=INDIRECT("Data!A"&(ROW(A7)-7)*9+30)
Here's how it works:
  1. ROW(A7) returns the row number of cell A7, which is 7.
  2. Subtracting 7 from 7 gives you 0, which is the offset you need to start at row 30.
  3. Multiplying 0 by 9 gives you 0, so you start at row 30.
  4. Adding 30 to 0 gives you 30, which is the row number you need to reference in the 'Data' sheet.
  5. The INDIRECT function takes this string and returns the value of the cell it refers to.

When you copy this formula down to cells A8, A9, etc., the ROW function will return the appropriate row number for each cell, and the formula will adjust accordingly.

So, for example, in cell A8, ROW(A8) returns 8, so the formula becomes:

Code:

=INDIRECT("Data!A"&(ROW(A8)-7)*9+30)
Which evaluates to:

Code:

=INDIRECT("Data!A39")
And returns the value of cell A39 in the 'Data' sheet.

I hope this helps! Let me know if you have any questions.


All times are GMT +1. The time now is 03:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com