Referencing a named range on another sheet

J

Jan B

I have forgotten how to reference a named range on another sheet in my
workbook. I have a YTD Summary sheet that I want to pull data into from my
monthly sheets in the same workbook. Monthly sheets are named Jan, Feb, Mar,
etc. Summary sheet in named Summary. Each of the monthly sheets has a cell
named Bills. The data on each monthly sheet is the same as the month before
it until changes for the germane month are entered. So, on the summary sheet
I don't want to see the data for that month until I'm in that month. Formula
for February should be something like the formula below, but I can't remember
how to do it!! Please help.
IF(MONTH(DATE)<=2,'Filename.xls'!sheetname[named range],0)
 
P

Pete_UK

The syntax is:

'[filename.xls]sheetname'!named_range

so you would need something like:

=IF(MONTH(date_cell)<=2,'[filename.xls]Feb'!Bills,0)

Hope this helps.

Pete
 
O

OssieMac

Hi Jan,

A little extra info. When you want a range or cell reference in a formula,
when you get to the point in the formula where you want to insert it, simply
change to the workbook and worksheet and select the cell or range and Excel
looks after the syntax for you. If the cell or range is named then Excel uses
the name in lieu of the address in the formula.

--
Regards,

OssieMac


Pete_UK said:
The syntax is:

'[filename.xls]sheetname'!named_range

so you would need something like:

=IF(MONTH(date_cell)<=2,'[filename.xls]Feb'!Bills,0)

Hope this helps.

Pete

I have forgotten how to reference a named range on another sheet in my
workbook. I have a YTD Summary sheet that I want to pull data into from my
monthly sheets in the same workbook. Monthly sheets are named Jan, Feb, Mar,
etc. Summary sheet in named Summary. Each of the monthly sheets has a cell
named Bills. The data on each monthly sheet is the same as the month before
it until changes for the germane month are entered. So, on the summary sheet
I don't want to see the data for that month until I'm in that month. Formula
for February should be something like the formula below, but I can't remember
how to do it!! Please help.
IF(MONTH(DATE)<=2,'Filename.xls'!sheetname[named range],0)
 
S

Shane Devenshire

Hi,

Actually the question is a little more complicated! If you really have a
cell on each sheet named Bills and you try to write the formula:

=SUM(Sheet2:Book2!Bill)

You will get a #Name? error message. You can scope the range names to the
sheet level but you can't use 3-D references with those. You would need to
write the formula as

=Sheet2!Bill+Sheet3!Bill and so on.

To reference a single range name on a separate sheet you don't need to
reference the File Name unless the formulas are in a different workbook. If
the range names are unique for the workbook you don't need to include the
sheet reference in your formula. In most cases it is a good idea not to use
sheet level names for exactly that reason. Instead you might name the ranges
JanBills, FebBills and so on.

This formula
IF(MONTH(DATE)<=2,'Filename.xls'!sheetname[named range],0)

=IF(MONTH(TODAY())>=2,Sheet2A1,0)
or
=IF(MONTH(TODAY())>=2,FebBills,0)
or
=IF(MONTH(TODAY())>=2,Feb!Bills,0)

Now if DATE is a range name for a cell containing a date you can replace the
TODAY() with DATE. However, keep in mind that Excel has a spreadsheet
function called DATE. Although that won't result in an error it might lead
to confusion by other people viewing your spreadsheet.
 
J

Jan B

Thanks, Shane. You hit the nail on the head - I was getting the #Name? error.
I will take your advice and create unique names.
Jan B


Shane Devenshire said:
Hi,

Actually the question is a little more complicated! If you really have a
cell on each sheet named Bills and you try to write the formula:

=SUM(Sheet2:Book2!Bill)

You will get a #Name? error message. You can scope the range names to the
sheet level but you can't use 3-D references with those. You would need to
write the formula as

=Sheet2!Bill+Sheet3!Bill and so on.

To reference a single range name on a separate sheet you don't need to
reference the File Name unless the formulas are in a different workbook. If
the range names are unique for the workbook you don't need to include the
sheet reference in your formula. In most cases it is a good idea not to use
sheet level names for exactly that reason. Instead you might name the ranges
JanBills, FebBills and so on.

This formula
IF(MONTH(DATE)<=2,'Filename.xls'!sheetname[named range],0)

=IF(MONTH(TODAY())>=2,Sheet2A1,0)
or
=IF(MONTH(TODAY())>=2,FebBills,0)
or
=IF(MONTH(TODAY())>=2,Feb!Bills,0)

Now if DATE is a range name for a cell containing a date you can replace the
TODAY() with DATE. However, keep in mind that Excel has a spreadsheet
function called DATE. Although that won't result in an error it might lead
to confusion by other people viewing your spreadsheet.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


Jan B said:
I have forgotten how to reference a named range on another sheet in my
workbook. I have a YTD Summary sheet that I want to pull data into from my
monthly sheets in the same workbook. Monthly sheets are named Jan, Feb, Mar,
etc. Summary sheet in named Summary. Each of the monthly sheets has a cell
named Bills. The data on each monthly sheet is the same as the month before
it until changes for the germane month are entered. So, on the summary sheet
I don't want to see the data for that month until I'm in that month. Formula
for February should be something like the formula below, but I can't remember
how to do it!! Please help.
IF(MONTH(DATE)<=2,'Filename.xls'!sheetname[named range],0)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top