Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Autoupdating a range with Vlookup?

I have a spreadsheet that calculates year to date information across a range
of columns (D through O). The problem is that there is always some info in
all 12 columns. Each month I update formulas to include an additional column
(e.g. sum(D2:J2) to sum(D2:K2). There are quite a few formulas to update. I
use an absolute cell reference in other formulas that specifies the number of
months (e.g. 8 months) and I would like to use a VLOOKUP formula to use this
value to determine what column my SUM formula should use. For example, if it
is month 8 I would like my SUM formulas to change to sum(D2:K2), in month 9
to sum(D2:L2) etc. There must be a simple way to do this - can anyone help?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Autoupdating a range with Vlookup?

Maybe you could use a formula like this in M2:

=SUM($D2:OFFSET($M2,0,-1))

I'm not sure how =vlookup() would fit in this.

Erin Dicks wrote:

I have a spreadsheet that calculates year to date information across a range
of columns (D through O). The problem is that there is always some info in
all 12 columns. Each month I update formulas to include an additional column
(e.g. sum(D2:J2) to sum(D2:K2). There are quite a few formulas to update. I
use an absolute cell reference in other formulas that specifies the number of
months (e.g. 8 months) and I would like to use a VLOOKUP formula to use this
value to determine what column my SUM formula should use. For example, if it
is month 8 I would like my SUM formulas to change to sum(D2:K2), in month 9
to sum(D2:L2) etc. There must be a simple way to do this - can anyone help?

Thanks.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Autoupdating a range with Vlookup?

Try this:

=SUM(D2:INDEX(D2:O2,n))

Where n = month number.

n can be a reference to another cell:

A1 = 8

=SUM(D2:INDEX(D2:O2,A1))

Note that if A1 is blank the formula will calculate the entire range.

Or, if the month number is based on the current date:

=SUM(D2:INDEX(D2:O2,MONTH(NOW())))

Biff

"Erin Dicks" wrote in message
...
I have a spreadsheet that calculates year to date information across a
range
of columns (D through O). The problem is that there is always some info in
all 12 columns. Each month I update formulas to include an additional
column
(e.g. sum(D2:J2) to sum(D2:K2). There are quite a few formulas to update.
I
use an absolute cell reference in other formulas that specifies the number
of
months (e.g. 8 months) and I would like to use a VLOOKUP formula to use
this
value to determine what column my SUM formula should use. For example, if
it
is month 8 I would like my SUM formulas to change to sum(D2:K2), in month
9
to sum(D2:L2) etc. There must be a simple way to do this - can anyone
help?

Thanks.



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
VLOOKUP - unable to highlight cell range Jane Excel Worksheet Functions 1 September 15th 06 03:34 AM
vlookup function does not work when range is hidden VLOOKUP FUNCTION Excel Discussion (Misc queries) 1 September 8th 06 07:46 PM
Vlookup in large named range KemS Excel Worksheet Functions 3 November 23rd 05 06:14 PM
Open Workbook - Select Range as table for vlookup Alan Excel Discussion (Misc queries) 4 November 3rd 05 06:56 PM
How do I use Range Names listed in a VLookup table in a formula? Essbasedvlpr32 Excel Worksheet Functions 3 December 15th 04 10:11 PM


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