I know how to make a named range in Excel.
I have a spreadsheet, with various columns going across as parameters, and then finally a formula in the last cell. This is repeated many times in each row, with each row having a different set of data, and the formula updated to reference the correct row index.
However, the formula looks like (three rows worth):
=G2*(10*D2 + 20*E2 + 5*F2)
=G3*(10*D3 + 20*E3 + 5*F3)
=G4*(10*D4 + 20*E4 + 5*F4)
I would like to use named ranges, but I can't find a way to do something like
=Count * (10*var1 + 20*var2 + 5*var3)
where count, var1, var2, and var3 automatically update to be the particular column of the current row. I can create a named range for every cell, but that isn't helpful. I can name range the column, but then I can't find a way to put an offset into the formula.
Also the whole point of this is readability, so if it ends up being some nasty complex formula function call, that probably doesn't help too much.
Simple, at least when using Excel 2010:
Using the example from Alex P:
Attention:
Using named columns this way, you cannot access any other row as the one your formula is in!
At least I'm not aware of the possibility to express something like <ColName>(row+1)...
I would suggest creating a Table. Select your range A1:H4
, then go to the Tables widget > New > Insert Table with Headers (on Mac). This will mark A2:H4
as body of the table, and A1:H4
as header.
From that, you get:
Count
, Radius
, Density
, Height
=[@Count]*(10*[@Radius] + 20*[@Density] + 5*[@Height])
H2
, Excel will automatically "copy down" this formula to all cells in column H
. So no more accidental inconsistencies in the formulas.H4
) and hit Tab
. Excel adds another row, and also makes sure to "copy down" your formula into the new row.Count
instead of G
for example).I can really recommend the video You Suck at Excel with Joel Spolsky which explains all of that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With