Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default dynamic cell references in formulas

I'd love to find an elegant way to do something.

I've got weekly information appended below each other in one sheet, and I'm
pulling data from it in another by using VLOOKUP. Right now I get the
beginning and ending rows for the lookup range, but have to manually input
them into the formula -- is there a way to build the array automatically for
the formula? I tried building and assembling text to represent the wanted
rows, but got errors. The trick is that the number of rows is not constant
from one week to the next.

Here's what I'm using now (manually setting rows in the third calc based on
values returned from the first two calcs):

beginning row=+VLOOKUP(W$36,'0740'!$A4:$D750,4,FALSE)
(look for the start date of the week, say 372 in this case)

ending row=+VLOOKUP(W$36+7,'0740'!$A4:$D750,4,FALSE)
(look for the start date of the next week, say 396 in this case)

the value lookup=+VLOOKUP($A40,'0740'!$A$372:$D$396,3,0)
(look for the value within the row range)

Any help to not have to manually update rows for future weeks will be
appreciated!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default dynamic cell references in formulas

Not tested, but I think this does it

=VLOOKUP($A40,INDIRECT("'0740'!$A$"&VLOOKUP(W$36,' 0740'!$A4:$D750,4,FALSE)&"
:$D$"&VLOOKUP(W$36+7,'0740'!$A4:$D750,4,FALSE)),3, 0)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"CarolM" wrote in message
...
I'd love to find an elegant way to do something.

I've got weekly information appended below each other in one sheet, and

I'm
pulling data from it in another by using VLOOKUP. Right now I get the
beginning and ending rows for the lookup range, but have to manually input
them into the formula -- is there a way to build the array automatically

for
the formula? I tried building and assembling text to represent the wanted
rows, but got errors. The trick is that the number of rows is not

constant
from one week to the next.

Here's what I'm using now (manually setting rows in the third calc based

on
values returned from the first two calcs):

beginning row=+VLOOKUP(W$36,'0740'!$A4:$D750,4,FALSE)
(look for the start date of the week, say 372 in this case)

ending row=+VLOOKUP(W$36+7,'0740'!$A4:$D750,4,FALSE)
(look for the start date of the next week, say 396 in this case)

the value lookup=+VLOOKUP($A40,'0740'!$A$372:$D$396,3,0)
(look for the value within the row range)

Any help to not have to manually update rows for future weeks will be
appreciated!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default dynamic cell references in formulas

Bob,

Awesome! Works great! Thanks! I now know how to get this and similar
things to work.


Carol


"Bob Phillips" wrote:

Not tested, but I think this does it

=VLOOKUP($A40,INDIRECT("'0740'!$A$"&VLOOKUP(W$36,' 0740'!$A4:$D750,4,FALSE)&"
:$D$"&VLOOKUP(W$36+7,'0740'!$A4:$D750,4,FALSE)),3, 0)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"CarolM" wrote in message
...
I'd love to find an elegant way to do something.

I've got weekly information appended below each other in one sheet, and

I'm
pulling data from it in another by using VLOOKUP. Right now I get the
beginning and ending rows for the lookup range, but have to manually input
them into the formula -- is there a way to build the array automatically

for
the formula? I tried building and assembling text to represent the wanted
rows, but got errors. The trick is that the number of rows is not

constant
from one week to the next.

Here's what I'm using now (manually setting rows in the third calc based

on
values returned from the first two calcs):

beginning row=+VLOOKUP(W$36,'0740'!$A4:$D750,4,FALSE)
(look for the start date of the week, say 372 in this case)

ending row=+VLOOKUP(W$36+7,'0740'!$A4:$D750,4,FALSE)
(look for the start date of the next week, say 396 in this case)

the value lookup=+VLOOKUP($A40,'0740'!$A$372:$D$396,3,0)
(look for the value within the row range)

Any help to not have to manually update rows for future weeks will be
appreciated!




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
Cell references in formulas Azipperusa Excel Discussion (Misc queries) 1 August 25th 09 04:05 AM
Dynamic Cell References in Excel nogga Excel Discussion (Misc queries) 2 March 23rd 09 07:21 PM
Dynamic formulas including worksheet references lars22222 Excel Worksheet Functions 1 July 26th 05 02:33 PM
dynamic cell references excel novice Excel Worksheet Functions 2 July 12th 05 02:59 PM
Dynamic Cell References jordanctc[_2_] Excel Programming 1 March 4th 04 04:08 PM


All times are GMT +1. The time now is 05:35 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"