ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Variable Range (https://www.excelbanter.com/excel-worksheet-functions/75419-variable-range.html)

sep1280

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


JE McGimpsey

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


Biff

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




JudithJubilee

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




All times are GMT +1. The time now is 08:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com