Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 40
Default INDIRECT function in Office 2007

I want to do something very simple, but I have trouble understanding the
parts of the INDIRECT function.
I have sheets called Jan, Feb, etc. In a separate sheet I wish to return the
value of cell B5 for each month in an array. My attempt was
=INDIRECT($A$1&'!B5) where A1 is the month, ie, Jan, Feb. This returns REF#.
Please could you advise. I assume I am making mistakes with my ampersands and
inverted commas.

Thanks, E
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default INDIRECT function in Office 2007

You need the text part of INDIRECT to be in quotes
=INDIRECT("'"&$A$1&"'!B5")

Note how single quotes surround sheet name, incase you ever have a space in
one of the names.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"E" wrote:

I want to do something very simple, but I have trouble understanding the
parts of the INDIRECT function.
I have sheets called Jan, Feb, etc. In a separate sheet I wish to return the
value of cell B5 for each month in an array. My attempt was
=INDIRECT($A$1&'!B5) where A1 is the month, ie, Jan, Feb. This returns REF#.
Please could you advise. I assume I am making mistakes with my ampersands and
inverted commas.

Thanks, E

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default INDIRECT function in Office 2007

E wrote...
....
=INDIRECT($A$1&'!B5) where A1 is the month, ie, Jan, Feb. This returns REF#.

....

Your formula above is syntactically invalid, so it seems you actually
have something different in Excel than what you posted to the
newsgroup.

Try

=INDIRECT("'"&$A$1&"'!B5")
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default INDIRECT function in Office 2007

Try it like this:

A1 = Jan (as a TEXT entry)

=INDIRECT(A1&"!B5")

Which evaluates to: =Jan!B5


--
Biff
Microsoft Excel MVP


"E" wrote in message
...
I want to do something very simple, but I have trouble understanding the
parts of the INDIRECT function.
I have sheets called Jan, Feb, etc. In a separate sheet I wish to return
the
value of cell B5 for each month in an array. My attempt was
=INDIRECT($A$1&'!B5) where A1 is the month, ie, Jan, Feb. This returns
REF#.
Please could you advise. I assume I am making mistakes with my ampersands
and
inverted commas.

Thanks, E



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 40
Default INDIRECT function in Office 2007

That's really helpful, thanks.
Do you know how I can make my 'B5' drag down so that it's B5, B6, B7 etc? I
fear I need to complicate the function.

"Luke M" wrote:

You need the text part of INDIRECT to be in quotes
=INDIRECT("'"&$A$1&"'!B5")

Note how single quotes surround sheet name, incase you ever have a space in
one of the names.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"E" wrote:

I want to do something very simple, but I have trouble understanding the
parts of the INDIRECT function.
I have sheets called Jan, Feb, etc. In a separate sheet I wish to return the
value of cell B5 for each month in an array. My attempt was
=INDIRECT($A$1&'!B5) where A1 is the month, ie, Jan, Feb. This returns REF#.
Please could you advise. I assume I am making mistakes with my ampersands and
inverted commas.

Thanks, E



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 40
Default INDIRECT function in Office 2007

Just worked it out, using ROW. Thanks.

"E" wrote:

That's really helpful, thanks.
Do you know how I can make my 'B5' drag down so that it's B5, B6, B7 etc? I
fear I need to complicate the function.

"Luke M" wrote:

You need the text part of INDIRECT to be in quotes
=INDIRECT("'"&$A$1&"'!B5")

Note how single quotes surround sheet name, incase you ever have a space in
one of the names.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"E" wrote:

I want to do something very simple, but I have trouble understanding the
parts of the INDIRECT function.
I have sheets called Jan, Feb, etc. In a separate sheet I wish to return the
value of cell B5 for each month in an array. My attempt was
=INDIRECT($A$1&'!B5) where A1 is the month, ie, Jan, Feb. This returns REF#.
Please could you advise. I assume I am making mistakes with my ampersands and
inverted commas.

Thanks, E

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default INDIRECT function in Office 2007

Try it like this...

Assume you want the results to appear starting in cell B1.

Entered in B1 and copied down as needed:

=INDEX(INDIRECT(A$1&"!B5:B100"),ROWS(B$1:B1))

Adjust for the correct end of range in B5:B100

--
Biff
Microsoft Excel MVP


"E" wrote in message
...
That's really helpful, thanks.
Do you know how I can make my 'B5' drag down so that it's B5, B6, B7 etc?
I
fear I need to complicate the function.

"Luke M" wrote:

You need the text part of INDIRECT to be in quotes
=INDIRECT("'"&$A$1&"'!B5")

Note how single quotes surround sheet name, incase you ever have a space
in
one of the names.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"E" wrote:

I want to do something very simple, but I have trouble understanding
the
parts of the INDIRECT function.
I have sheets called Jan, Feb, etc. In a separate sheet I wish to
return the
value of cell B5 for each month in an array. My attempt was
=INDIRECT($A$1&'!B5) where A1 is the month, ie, Jan, Feb. This returns
REF#.
Please could you advise. I assume I am making mistakes with my
ampersands and
inverted commas.

Thanks, E



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default INDIRECT function in Office 2007

"T. Valko" wrote...
....
Entered in B1 and copied down as needed:

=INDEX(INDIRECT(A$1&"!B5:B100"),ROWS(B$1:B1))

....

Ugh! That's a technical assessment.

If the OP wants the value from cell B1 in the worksheet named in cell
A1 in the current worksheet in cell B1 in the current worksheet, more
general to use

=INDIRECT("'"&$A$1&"'!RC",0)

Rule-of-thumb: if you need to use INDIRECT for relative references,
there's NEVER a good reason to use A1-style referencing in INDIRECT's
first argument.
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default INDIRECT function in Office 2007

That's a generic formula that can be entered anywhere.

The OP didn't say where the formula would be entered. I don't like using
ROW(), COLUMN() or the equivalent "RC". Depending on where the formula is
entered then you might have to calculate an offset.

--
Biff
Microsoft Excel MVP


"Harlan Grove" wrote in message
...
"T. Valko" wrote...
...
Entered in B1 and copied down as needed:

=INDEX(INDIRECT(A$1&"!B5:B100"),ROWS(B$1:B1))

...

Ugh! That's a technical assessment.

If the OP wants the value from cell B1 in the worksheet named in cell
A1 in the current worksheet in cell B1 in the current worksheet, more
general to use

=INDIRECT("'"&$A$1&"'!RC",0)

Rule-of-thumb: if you need to use INDIRECT for relative references,
there's NEVER a good reason to use A1-style referencing in INDIRECT's
first argument.



  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default INDIRECT function in Office 2007

"T. Valko" wrote...
That's a generic formula that can be entered anywhere.


Yup. That's the point.

The OP didn't say where the formula would be entered. I don't like using
ROW(), COLUMN() or the equivalent "RC". Depending on where the formula is
entered then you might have to calculate an offset.


The horrors!

OK, not as good as R1C1-style, but still more flexible, if you want
cell B1 in the active worksheet to refer to cell B5 in the workbook
named in cell A1 of the active worksheet, then try the following as
the cell B1 formula.

=INDIRECT("'"&$A$1&'!"&CELL("Address",B5))

Then again, if there were only 12 varying worksheets, you could define
the names

JanWS =Jan!$1:$65536
FebWS =Feb!$1:$65536
MarWS =Mar!$1:$65536
AprWS =Apr!$1:$65536
MayWS =May!$1:$65536
JunWS =Jun!$1:$65536
JulWS =Jul!$1:$65536
AugWS =Aug!$1:$65536
SepWS =Sep!$1:$65536
OctWS =Oct!$1:$65536
NovWS =Nov!$1:$65536
DecWS =Dec!$1:$65536

UseWS
=CHOOSE(MATCH($A$1,
{"Jan";"Feb";"Mar";"Apr";"May";"Jun";"Jul";"Aug";" Sep";"Oct";"Nov";"Dec"},
0),
JanWS,FebWS,MarWS,AprWS,MayWS,JunWS,JulWS,AugWS,Se pWS,OctWS,NovWS,DecWS)

Then use formulas like

=INDEX(UseWS,ROWS(...),COLUMNS(...))

to avoid volatile functions entirely. If there'd be a lot of these
formulas, volatile function calls can take quite a toll on recalc
performance.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Indirect function in Excel 2007 brewdon Excel Worksheet Functions 0 June 4th 08 12:45 AM
My office 2007 live preview function is not working. Know why?? firemandpp Excel Discussion (Misc queries) 2 March 21st 08 01:39 PM
DMAX function for Office 2007 jswiryd via OfficeKB.com Excel Worksheet Functions 1 October 31st 07 03:16 PM
can not find the pivot function in office 2007 Tom Tang Excel Discussion (Misc queries) 1 November 29th 06 11:46 AM
Can not find Pivot function in office 2007 Tom Tang Excel Worksheet Functions 1 September 12th 06 02:58 PM


All times are GMT +1. The time now is 12:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"