Create Named Ranges from Cells

pto160

Active Member
Joined
Feb 1, 2009
Messages
478
Office Version
  1. 365
Platform
  1. Windows
I'm trying to create Named excel ranges for one column with different row ranges based on the month in my case. Is there any way to do this from a cell range selection.
So in my case Column B is where are the names of the ranges, and column C is the ranges itself. It takes a long time manually to do this.

Sheet1

BC
2Expense_Jan_13=Sheet2!A2:A10
3Expense_Feb_13=Sheet2!A11:A20
4Expense_Mar_13=Sheet2!A21:A30

<colgroup> <col style="WIDTH: 30px; FONT-WEIGHT: bold"> <col style="WIDTH: 107px"> <col style="WIDTH: 110px"></colgroup> <tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
why not just give column B a named range and then the same for column C. Use either INDEX & MATCH or VLOOKUP to return corresponding value. Alternatively, place the data in a table (Ctrl+T) and it will do it automatically.
 
Upvote 0
I think I know what you're getting at. Yes, thinking about it I would like to use Dynamic Named ranges since I don't have to keep adjusting the ranges. The formula I would be looking for would be the first and last row of the month for the range I'm looking for like July. My data is sorted by date.
Sheet1

AB
2Jul_A10
3Jul_A20
4Jul_A10
5Aug_A20
6Aug_A30
7Aug_A40
8Aug_A50

<colgroup> <col style="WIDTH: 30px; FONT-WEIGHT: bold"> <col style="WIDTH: 64px"> <col style="WIDTH: 64px"></colgroup> <tbody>
</tbody>

So Range1=$B2:$B4. A formula would see the first row Jul_A occurs is row 2 and the last row is row 4
Range2=$B$5:$B$B8

I'm basically using Column A to figure out the row ranges.

How do you do this?
Excel tables to the web >> Excel Jeanie HTML 4
 
Upvote 0
What are you trying to acheive with the named ranges? If you put it in table format you can just use a SUMIF function to work out the totals of the months.
 
Upvote 0
I'm using index and match with the ranges to get a specific match. I want the range to be the month in question I'm trying to get the match for. Speadsheet is very big so named ranges is essential based on month.
 
Upvote 0
I have the formula for the row portion.
=
=small(ifA2:A8="Jul_A",row(A2:A8),1)
That's for the first row or the month in question.
For the last row.
=large(ifA2:A8="Jul_A",row(A2:A8),1)
How do you get the column B in the formula so Excel will read B2:B5 for the range Jul_A?
Can anyone help?
 
Upvote 0
Personally, i wouldnt fix the formula with "Jul_A" as you will have to change it every time. Make it reference to a cell and fix that cell - so much easier!
Nonetheless, assuming your first formula is correct, change your second to :

=large(if(A2:A8="Jul_A",row(b2:b8),1)
 
Upvote 0

Forum statistics

Threads
1,215,428
Messages
6,124,832
Members
449,190
Latest member
rscraig11

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