Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default How to change cell reference within formulas

I have some formulas that refer to other workbooks. I want the formula to
point to a different column, depending on the current month; e.g., in
January, the data will be in column E (and relative row references), in
February, the data will be in column F, and so on.

How do I create the formula with the cell reference as a "Variable" that can
refer to other cells where the correct column identifier is indicated via the
VLOOKUP function, or is just entered?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default How to change cell reference within formulas

Say your datalist runs from A1 to M15,
With your lookup values in A2 to A15,
And your months in B1 to M15.

Enter value to lookup in A20,
And month to return in B20,
And try this:

=INDEX(B2:M15,MATCH(A20,A2:A15,0),MATCH(B20,B1:M1, 0))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"CGSoniat" wrote in message
...
I have some formulas that refer to other workbooks. I want the formula to
point to a different column, depending on the current month; e.g., in
January, the data will be in column E (and relative row references), in
February, the data will be in column F, and so on.

How do I create the formula with the cell reference as a "Variable" that
can
refer to other cells where the correct column identifier is indicated via
the
VLOOKUP function, or is just entered?


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default How to change cell reference within formulas

Typo!

Months are in B1 to M1 ... *not* M15.
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"RagDyer" wrote in message
...
Say your datalist runs from A1 to M15,
With your lookup values in A2 to A15,
And your months in B1 to M15.

Enter value to lookup in A20,
And month to return in B20,
And try this:

=INDEX(B2:M15,MATCH(A20,A2:A15,0),MATCH(B20,B1:M1, 0))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"CGSoniat" wrote in message
...
I have some formulas that refer to other workbooks. I want the formula to
point to a different column, depending on the current month; e.g., in
January, the data will be in column E (and relative row references), in
February, the data will be in column F, and so on.

How do I create the formula with the cell reference as a "Variable" that
can
refer to other cells where the correct column identifier is indicated via
the
VLOOKUP function, or is just entered?



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default How to change cell reference within formulas

Thanks for your suggestion.

When I use the Match function to determine the column number for the current
month's data, e.g., =MATCH(R35C1,R36C2:R36C13), where R35C1 contains "Jan",
and R36C2:R36C13 contains "Jan", "Feb", "Mar", etc, it returns a value of 1,
which is correct, the first column in the array.

However, when I imbed the Match function inside of the Index function, e.g.,
=INDEX('[Copy of 2005 Production
Archive.xls]Banner'!RC5:RC16,3,MATCH(R35C1,R36C2:R36C13)+4), I get a
reference error #REF!.

If I manually substutute the correct column number (5) in the INDEX
function's syntax (removing the MATCH syntax), it retrieves the correct data.


My data is in D3:P32 of the spreadsheet, 'Copy of 2005 Production
Archive.xls', worsheet named 'Banner'

My reference cell is A35 in the current worksheet, and my Month names to
lookup, are in B36:M36, of the current worksheet.

Thanks for the help.

"RagDyer" wrote:

Say your datalist runs from A1 to M15,
With your lookup values in A2 to A15,
And your months in B1 to M15.

Enter value to lookup in A20,
And month to return in B20,
And try this:

=INDEX(B2:M15,MATCH(A20,A2:A15,0),MATCH(B20,B1:M1, 0))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"CGSoniat" wrote in message
...
I have some formulas that refer to other workbooks. I want the formula to
point to a different column, depending on the current month; e.g., in
January, the data will be in column E (and relative row references), in
February, the data will be in column F, and so on.

How do I create the formula with the cell reference as a "Variable" that
can
refer to other cells where the correct column identifier is indicated via
the
VLOOKUP function, or is just entered?



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default How to change cell reference within formulas

Post the actual formula you're having trouble with.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"CGSoniat" wrote in message
...
Thanks for your suggestion.

When I use the Match function to determine the column number for the
current
month's data, e.g., =MATCH(R35C1,R36C2:R36C13), where R35C1 contains
"Jan",
and R36C2:R36C13 contains "Jan", "Feb", "Mar", etc, it returns a value of
1,
which is correct, the first column in the array.

However, when I imbed the Match function inside of the Index function,
e.g.,
=INDEX('[Copy of 2005 Production
Archive.xls]Banner'!RC5:RC16,3,MATCH(R35C1,R36C2:R36C13)+4), I get a
reference error #REF!.

If I manually substutute the correct column number (5) in the INDEX
function's syntax (removing the MATCH syntax), it retrieves the correct
data.


My data is in D3:P32 of the spreadsheet, 'Copy of 2005 Production
Archive.xls', worsheet named 'Banner'

My reference cell is A35 in the current worksheet, and my Month names to
lookup, are in B36:M36, of the current worksheet.

Thanks for the help.

"RagDyer" wrote:

Say your datalist runs from A1 to M15,
With your lookup values in A2 to A15,
And your months in B1 to M15.

Enter value to lookup in A20,
And month to return in B20,
And try this:

=INDEX(B2:M15,MATCH(A20,A2:A15,0),MATCH(B20,B1:M1, 0))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"CGSoniat" wrote in message
...
I have some formulas that refer to other workbooks. I want the formula
to
point to a different column, depending on the current month; e.g., in
January, the data will be in column E (and relative row references), in
February, the data will be in column F, and so on.

How do I create the formula with the cell reference as a "Variable"
that
can
refer to other cells where the correct column identifier is indicated
via
the
VLOOKUP function, or is just entered?




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
How do I change the default cell reference from absolute to relati JZing Setting up and Configuration of Excel 3 July 19th 06 01:03 AM
Reference Cell Color From Other WorkSheets carCiNogn Excel Worksheet Functions 1 May 17th 06 09:35 PM
Cell Reference with Range Name SCSC Excel Worksheet Functions 2 March 23rd 06 11:32 PM
How do I change a cell range with a reference cell? Danneskjold Excel Discussion (Misc queries) 2 August 11th 05 07:37 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 06:32 AM.

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"