Defining a name for more than one range

joylee

New Member
Joined
Oct 12, 2019
Messages
15
Office Version
  1. 2016
Platform
  1. Windows
Dear,
No problem for defining a name for a single data range. However, I have situation to make a frequency table using data in two separate ranges, for example B2:C5 and D2:E6. Is there a way to define these two ranges as one name so I can use '=frequency(the name, bin range)?' Thank you, joylee
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Select the two ranges (select the first then hold down the CTRL key while selecting the second) and then type the Defined Name for this discontinuous range in the Name Box (located to the left of the Formula Bar). I haven't tested it (I'll let you do that), so I am not sure how well the FREQUENCY function will handle discontinuous ranges though.
 
Last edited:
Upvote 0
Thank you very much. It works perfectly when I have two ranges in the same sheet. However, if they are in different sheets, I cannot define a name with the 'control' key. I have tried to define by typing in the range addresses in the name manager box. For example, the name 'AA' by '=sheet1!$A$1, sheet2!$A$1'
EXCEL does not give me any error for defining this way but when I calculate with AA, for example, =sum(AA), gives me #VALUE ! error.
Your further help will be greatly appreciated. JYLee
 
Upvote 0
Why got:
Give the Range in Sheet(1) the Name "Apple"
Give the Range in Sheet(2) the Name "Pie"

Then use the formula:

=Sum(Apple)+Sum(Pie)
 
Upvote 0
I have tried to define by typing in the range addresses in the name manager box. For example, the name 'AA' by '=sheet1!$A$1, sheet2!$A$1'
I am hardly an expert on Defined Names so others who are will hopefully chime in, but I could not find a way to create a disjointed Defined Name that is usable. The closest I could come to what you tried above was this..

=Sheet1:Sheet2!$A$1

However, note that this encompasses those two sheets and all other sheets physically located between them. So, if you inserted a sheet between Sheet1 and Sheet2 and put a value in A1 of that sheet, using SUM on that Defined Name would sum cell A1 on Sheet1, Sheet2 and that inserted sheet. As I said, I could not find any way to define two (and I presume or more) disjointed ranges located on different sheets that did not involve the same cell or cells within a range of sheets.
 
Upvote 0
Well thank you. But my original task is more than simple addition using =sum(). For example, I want to have a frequency table using two separate ranges of data in different sheets.
JYLee
 
Upvote 0
Thank you. I have data on different sheets. The only thing I can do now may be, as you kindly found out, that I have to rearrange all my data to be the same address in different sheets.
JYLee
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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