Self-expanding range

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
1,560
Office Version
  1. 365
Platform
  1. Windows
I make use of a lot of named ranges. They make the expressions so much easier to read and debug.

I also make use of the Offset function in the Refers to: field in the Name Manager. In the table below, I assigned the name "Products" to Column C (C:C) and "YTD" to Column G. I can then use the formulas in Column G to calculate the totals. If I add a new Column G for Apr, the Sum formulas, now in Column H, will continue to work.

1616171289109.png


An even tidier formula is in D11. I assigned D6 the name "JanHdr" and D10 the name "JanFtr". I then defined the name "Jan" as "=offset(JanHdr,1,0) : offset(JanFtr,-1,0)". This makes the formula in D11 work. And if I add a new product row after Row 9, the formula now in D12 will still work.

Here's my question. If I assign the name "SalesTable" to the entire area (D7:F9), is there a way that I can use that name in a cell and it will use either the column or the row depending on where the cell is?

For example, is there an expression that I can put in D11 that will sum that column (something like "=sum(column(@SalesTable))", or in G7 that will sum that row (=sum(row(@SalesTable))?

Thanks

How do I keep an expression like =offset(JanHdr,1,0):eek:ffset(JanFtr,-1,0) for converting the ": offset" into an emoji?
 

rhombus4

Active Member
Joined
May 26, 2010
Messages
488
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Yep, I just found that out. I just have to right-click on any cell and then select insert row or column. Slick


I don't understand this part. Does that go in the table definition? I tried something like that and it complained that it did not overlap the existing table, or something like that.
Have a look here Dynamic named ranges

Also for tables you can click anywhere in your data and press ctrl + T to insert a table
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,141,121
Messages
5,704,427
Members
421,347
Latest member
vrajesh544

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
Top