#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
sep1280
 
Posts: n/a
Default Variable Range


Hi,
I am using VLOOKUP functions throughout my workbook that looks at the
last worksheet which contains equipment costs. An example is:

=IF(B30<"",IF(ISERROR(VLOOKUP(B30,'Equipment
Costs'!$A$2:$D$895,4,FALSE)),"No Match",VLOOKUP(B30,'Equipment
Costs'!$A$2:$D$895,4,FALSE)),0)

The problem is that I often update my equipment costs worksheet, which
then could grow or decrease in size. Then the range for the hundreds
of VLOOKUP functions are incorrect. Is there a way instead of using
the range 'Equipment Costs'!$A$2:$D$895, I could change the formula to
one cell that will define the range? When I type a cell reference in
the VLOOKUP function, it won't use that cells value for the range.
Excel is looking at it as the range. Any ideas? Thanks in advance!
Scott


--
sep1280
------------------------------------------------------------------------
sep1280's Profile: http://www.excelforum.com/member.php...o&userid=32175
View this thread: http://www.excelforum.com/showthread...hreadid=519237

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JE McGimpsey
 
Posts: n/a
Default Variable Range

Since you're using the exact match switch, you can probably use the
entire column:

=IF(B30<"",IF(ISNA(MATCH(B30, 'Equipment Costs'!$A:$A, FALSE)), "No
Match", VLOOKUP(B30, 'Equipment Costs'!$A:$D, 4, FALSE)), 0)

In article ,
sep1280 wrote:

Hi,
I am using VLOOKUP functions throughout my workbook that looks at the
last worksheet which contains equipment costs. An example is:

=IF(B30<"",IF(ISERROR(VLOOKUP(B30,'Equipment
Costs'!$A$2:$D$895,4,FALSE)),"No Match",VLOOKUP(B30,'Equipment
Costs'!$A$2:$D$895,4,FALSE)),0)

The problem is that I often update my equipment costs worksheet, which
then could grow or decrease in size. Then the range for the hundreds
of VLOOKUP functions are incorrect. Is there a way instead of using
the range 'Equipment Costs'!$A$2:$D$895, I could change the formula to
one cell that will define the range? When I type a cell reference in
the VLOOKUP function, it won't use that cells value for the range.
Excel is looking at it as the range. Any ideas? Thanks in advance!
Scott

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default Variable Range

Hi!

A couple of options.

If there is no data below your lookup table just use entire columns as range
references:

VLOOKUP(B30,'Equipment Costs'!$A:$D,4,FALSE))

Or use dynamic ranges (ranges that automatically adjust as data is
added/deleted). See instructions he

http://contextures.com/xlNames01.html#Dynamic

Biff

"sep1280" wrote in
message ...

Hi,
I am using VLOOKUP functions throughout my workbook that looks at the
last worksheet which contains equipment costs. An example is:

=IF(B30<"",IF(ISERROR(VLOOKUP(B30,'Equipment
Costs'!$A$2:$D$895,4,FALSE)),"No Match",VLOOKUP(B30,'Equipment
Costs'!$A$2:$D$895,4,FALSE)),0)

The problem is that I often update my equipment costs worksheet, which
then could grow or decrease in size. Then the range for the hundreds
of VLOOKUP functions are incorrect. Is there a way instead of using
the range 'Equipment Costs'!$A$2:$D$895, I could change the formula to
one cell that will define the range? When I type a cell reference in
the VLOOKUP function, it won't use that cells value for the range.
Excel is looking at it as the range. Any ideas? Thanks in advance!
Scott


--
sep1280
------------------------------------------------------------------------
sep1280's Profile:
http://www.excelforum.com/member.php...o&userid=32175
View this thread: http://www.excelforum.com/showthread...hreadid=519237



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JudithJubilee
 
Posts: n/a
Default Variable Range

Hello sep1280,

If you name your ranges instead of refering to them by their cell references
you should be able to add to your original data.

Highlight A2:D895 and press Ctrl + F3. Give the range a name eg.
EquipmentCosts (no spaces allowed).

Your formula will then be:

=IF(B30<"",IF(ISERROR(VLOOKUP(B30,EquipmentCosts, 4,FALSE)),"No
Match",VLOOKUP(B30,EquipmentCosts,4,FALSE)),0)

As long as you insert your new cost rows between the first and last row of
the range the formulas will update. OR you could make the range bigger than
it is to leave room for extra cost rows.

Judith

--
Hope this helps


"sep1280" wrote:


Hi,
I am using VLOOKUP functions throughout my workbook that looks at the
last worksheet which contains equipment costs. An example is:

=IF(B30<"",IF(ISERROR(VLOOKUP(B30,'Equipment
Costs'!$A$2:$D$895,4,FALSE)),"No Match",VLOOKUP(B30,'Equipment
Costs'!$A$2:$D$895,4,FALSE)),0)

The problem is that I often update my equipment costs worksheet, which
then could grow or decrease in size. Then the range for the hundreds
of VLOOKUP functions are incorrect. Is there a way instead of using
the range 'Equipment Costs'!$A$2:$D$895, I could change the formula to
one cell that will define the range? When I type a cell reference in
the VLOOKUP function, it won't use that cells value for the range.
Excel is looking at it as the range. Any ideas? Thanks in advance!
Scott


--
sep1280
------------------------------------------------------------------------
sep1280's Profile: http://www.excelforum.com/member.php...o&userid=32175
View this thread: http://www.excelforum.com/showthread...hreadid=519237


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
from Range variable Marina Limeira Charts and Charting in Excel 0 January 22nd 06 02:35 PM
Match function...random search? Les Excel Worksheet Functions 10 July 28th 05 11:54 AM
How to use a variable for a range Jeff Lowenstein Excel Worksheet Functions 1 July 26th 05 02:14 AM
Is it possible to set a variable range in a macro? Mary About this forum 0 June 12th 05 06:26 PM
Set Data Range by Variable MJSlattery Excel Discussion (Misc queries) 4 June 10th 05 07:48 AM


All times are GMT +1. The time now is 09:42 AM.

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

About Us

"It's about Microsoft Excel"