Row number as text which gets used to create formulas

BillPeterson

New Member
Joined
Jan 16, 2022
Messages
22
Office Version
  1. 365
Platform
  1. Windows
Hi, I want to enter a row number in one column, which is then used to create formulas pointing to cells in that row. Any hints? So far no luck.

Background for those interested: I have a financial spreadsheet in which today's data always goes on the last free row. Then several formulas copied down are taking today's entry and calculating how much it's changed since some earlier date (say beginning of a new year or after a redistribution). Whenever it's time to set the new starting row I have to update like 30 formulas which is annoying. Seems like there ought to be a way to just say ok from here on out, all those formulas are going to use this new row number (in a single cell) as the starting point. For example, one of the formulas is simply returning the difference between today (current row) and the starting point (earlier row).

Excel Formula:
=A100-A$1

For example, instead of me manually having to update the "A$1" to "A$5" or whatever like every quarter, I'd like Excel to get the row variable from another column which contains just "X" and then create the new cell reference automatically "A$X". That way I can just update the row number every quarter and have all the difference and %chg columns use that.

This page is awesome thanks in advance for your for your help!!!!
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hi,

You mean this?

Book3.xlsx
AB
191882
Sheet1050
Cell Formulas
RangeFormula
B19B19=100-INDIRECT("A"&19)
 
Upvote 0
On second thought, may be you mean this:

Book3.xlsx
AB
1855
19A1845
Sheet1050
Cell Formulas
RangeFormula
B19B19=100-INDIRECT(A19)
 
Upvote 0
Sorry my original post might have been confusing. For example below, I'd like the formulas in columns C and D to use the "ref row" information. Notice how on row 10 the formulas in columns cell C and D start using A$10 instead of A$2. I've been manually updating these formulas and now want to just use the information in Column B to create those cell references (not even sure this is the right term, but basically trying to say I want to create a variable cell location based on Column B instead of a fixed cell location requiring significant maintenance). How do I tie the formulas in columns C & D to use the information in Column B to do this?

Finances.xlsx
ABCD
1stock priceref rowchange%change
2$ 1002$ -0%
3$ 992$ (1)-1%
4$ 1012$ 11%
5$ 1002$ -0%
6$ 1022$ 22%
7$ 1012$ 11%
8$ 1032$ 33%
9$ 1022$ 22%
10$ 10410$ -0%
11$ 10510$ 11%
12$ 10610$ 22%
Workspace
Cell Formulas
RangeFormula
C2:C9C2=A2-A$2
D2:D9,D12D2=C2/A$2
C10:C12C10=A10-A$10
D10:D11D10=C10/A$10
 
Upvote 0
The method in Post #3 should work:

Book3.xlsx
ABCD
1stock priceref rowchange%change
2100A200%
399-1-1%
410111%
510000%
610222%
710111%
810333%
910222%
10104A1000%
1110511%
1210622%
13
14stock priceref rowchange%change
15100A200%
1699A2-1-1%
17101A211%
18100A200%
19102A222%
20101A211%
21103A233%
22102A222%
23104A1000%
24105A1011%
25106A1022%
Sheet3
Cell Formulas
RangeFormula
C2:C9C2=A2-INDIRECT(B$2)
D2:D9D2=C2/INDIRECT(B$2)
C10:C12C10=A10-INDIRECT(B$10)
D10:D12D10=C10/INDIRECT(B$10)
C15:C25C15=A15-INDIRECT(B15)
D15:D25D15=C15/INDIRECT(B15)
 
Upvote 0
On second thought, may be you mean this:

Book3.xlsx
AB
1855
19A1845
Sheet1050
Cell Formulas
RangeFormula
B19B19=100-INDIRECT(A19)

Thank you yes getting closer. I've tried using INDIRECT in the past which is definitely useful. Do I also need column info? Or is there a way to take a row number in a cell reference and make it a variable?
 
Upvote 0
The method in Post #3 should work:

Book3.xlsx
ABCD
1stock priceref rowchange%change
2100A200%
399-1-1%
410111%
510000%
610222%
710111%
810333%
910222%
10104A1000%
1110511%
1210622%
13
14stock priceref rowchange%change
15100A200%
1699A2-1-1%
17101A211%
18100A200%
19102A222%
20101A211%
21103A233%
22102A222%
23104A1000%
24105A1011%
25106A1022%
Sheet3
Cell Formulas
RangeFormula
C2:C9C2=A2-INDIRECT(B$2)
D2:D9D2=C2/INDIRECT(B$2)
C10:C12C10=A10-INDIRECT(B$10)
D10:D12D10=C10/INDIRECT(B$10)
C15:C25C15=A15-INDIRECT(B15)
D15:D25D15=C15/INDIRECT(B15)


Thank you. But is there a way to do that without the column information without adding it? Ideally I just want to update the row number. There are about 50 sets of columns C and D from the example above and they are all looking at information from different columns (not just A).
 
Upvote 0
I'm afraid I can't think of a way to use a cell reference as the row variable to reference another cell...
 
Upvote 0
How about
+Fluff 1.xlsm
ABCD
1stock priceref rowchange%change
2100200%
3992-1-1%
4101211%
5100200%
6102222%
7101211%
8103233%
9102222%
101041000%
111051011%
121061022%
Main
Cell Formulas
RangeFormula
C2:C12C2=A2-INDEX(A:A,B2)
D2:D12D2=C2/INDEX(A:A,B2)
 
Upvote 0
Solution
Thought of OFFSET, but I like Fluff's INDEX better:

Book3.xlsx
ABCDEFGHI
1stock priceref rowchange%changestock priceref rowchange%change
2100200%100200%
399-1-1%992-1-1%
410111%101211%
510000%100200%
610222%102222%
710111%101211%
810333%103233%
910222%102222%
101041000%1041000%
1110511%1051011%
1210622%1061022%
Sheet9
Cell Formulas
RangeFormula
C2:C9C2=A2-OFFSET(C2,B$2-ROW(),-2)
D2:D9D2=C2/OFFSET(C2,B$2-ROW(),-2)
C10:C12C10=A10-OFFSET(C10,B$10-ROW(),-2)
D10:D12D10=C10/OFFSET(C10,B$10-ROW(),-2)
H2:H12H2=F2-OFFSET(H2,G2-ROW(),-2)
I2:I12I2=H2/OFFSET(H2,G2-ROW(),-2)
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,370
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top