Hi All,
I hope someone can help me how to use the vlookup to find data in a set of range that may change.
Sheet 1 is the place where I need to find qty of each item in each warehouse.
Sheet 2 is the data that will be downloaded from database.
I can use vlookup to find the qty of each item in each warehouse, but the problem is that the range will change when there's new items coming in (the row will get longer).
Sheet 1[TABLE="width: 467"]
<tbody>[TR]
[TD]Item name
[/TD]
[TD]Warehouse A
[/TD]
[TD]Warehouse B
[/TD]
[TD]Warehouse C
[/TD]
[TD]Warehouse D
[/TD]
[/TR]
[TR]
[TD]GL43
[/TD]
[TD="align: right"]100
[/TD]
[TD="align: right"]200
[/TD]
[TD="align: right"]50
[/TD]
[TD="align: right"]300
[/TD]
[/TR]
[TR]
[TD]GL44
[/TD]
[TD="align: right"]50
[/TD]
[TD="align: right"]50
[/TD]
[TD="align: right"]100
[/TD]
[TD="align: right"]300
[/TD]
[/TR]
[TR]
[TD]GL73
[/TD]
[TD="align: right"]50
[/TD]
[TD="align: right"]100
[/TD]
[TD="align: right"]50
[/TD]
[TD="align: right"]250
[/TD]
[/TR]
[TR]
[TD]GL74
[/TD]
[TD="align: right"]30
[/TD]
[TD="align: right"]100
[/TD]
[TD="align: right"]75
[/TD]
[TD="align: right"]500
[/TD]
[/TR]
</tbody>[/TABLE]
Sheet 2
[TABLE="width: 226"]
<tbody>[TR]
[TD]Warehouse
[/TD]
[TD]Item name
[/TD]
[TD]Quantity
[/TD]
[/TR]
[TR]
[TD]A
[/TD]
[TD]GL43
[/TD]
[TD="align: right"]100
[/TD]
[/TR]
[TR]
[TD]A
[/TD]
[TD]GL44
[/TD]
[TD="align: right"]50
[/TD]
[/TR]
[TR]
[TD]A
[/TD]
[TD]GL73
[/TD]
[TD="align: right"]50
[/TD]
[/TR]
[TR]
[TD]A
[/TD]
[TD]GL74
[/TD]
[TD="align: right"]30
[/TD]
[/TR]
[TR]
[TD]B
[/TD]
[TD]GL43
[/TD]
[TD="align: right"]200
[/TD]
[/TR]
[TR]
[TD]B
[/TD]
[TD]GL44
[/TD]
[TD="align: right"]50
[/TD]
[/TR]
[TR]
[TD]B
[/TD]
[TD]GL73
[/TD]
[TD="align: right"]100
[/TD]
[/TR]
[TR]
[TD]B
[/TD]
[TD]GL74
[/TD]
[TD="align: right"]100
[/TD]
[/TR]
[TR]
[TD]C
[/TD]
[TD]GL43
[/TD]
[TD="align: right"]50
[/TD]
[/TR]
[TR]
[TD]C
[/TD]
[TD]GL44
[/TD]
[TD="align: right"]100
[/TD]
[/TR]
[TR]
[TD]C
[/TD]
[TD]GL73
[/TD]
[TD="align: right"]50
[/TD]
[/TR]
[TR]
[TD]C
[/TD]
[TD]GL74
[/TD]
[TD="align: right"]75
[/TD]
[/TR]
[TR]
[TD]D
[/TD]
[TD]GL43
[/TD]
[TD="align: right"]300
[/TD]
[/TR]
[TR]
[TD]D
[/TD]
[TD]GL44
[/TD]
[TD="align: right"]300
[/TD]
[/TR]
[TR]
[TD]D
[/TD]
[TD]GL73
[/TD]
[TD="align: right"]250
[/TD]
[/TR]
[TR]
[TD]D
[/TD]
[TD]GL74
[/TD]
[TD="align: right"]500
[/TD]
[/TR]
</tbody>[/TABLE]
Thanks in advance
I hope someone can help me how to use the vlookup to find data in a set of range that may change.
Sheet 1 is the place where I need to find qty of each item in each warehouse.
Sheet 2 is the data that will be downloaded from database.
I can use vlookup to find the qty of each item in each warehouse, but the problem is that the range will change when there's new items coming in (the row will get longer).
Sheet 1[TABLE="width: 467"]
<tbody>[TR]
[TD]Item name
[/TD]
[TD]Warehouse A
[/TD]
[TD]Warehouse B
[/TD]
[TD]Warehouse C
[/TD]
[TD]Warehouse D
[/TD]
[/TR]
[TR]
[TD]GL43
[/TD]
[TD="align: right"]100
[/TD]
[TD="align: right"]200
[/TD]
[TD="align: right"]50
[/TD]
[TD="align: right"]300
[/TD]
[/TR]
[TR]
[TD]GL44
[/TD]
[TD="align: right"]50
[/TD]
[TD="align: right"]50
[/TD]
[TD="align: right"]100
[/TD]
[TD="align: right"]300
[/TD]
[/TR]
[TR]
[TD]GL73
[/TD]
[TD="align: right"]50
[/TD]
[TD="align: right"]100
[/TD]
[TD="align: right"]50
[/TD]
[TD="align: right"]250
[/TD]
[/TR]
[TR]
[TD]GL74
[/TD]
[TD="align: right"]30
[/TD]
[TD="align: right"]100
[/TD]
[TD="align: right"]75
[/TD]
[TD="align: right"]500
[/TD]
[/TR]
</tbody>[/TABLE]
Sheet 2
[TABLE="width: 226"]
<tbody>[TR]
[TD]Warehouse
[/TD]
[TD]Item name
[/TD]
[TD]Quantity
[/TD]
[/TR]
[TR]
[TD]A
[/TD]
[TD]GL43
[/TD]
[TD="align: right"]100
[/TD]
[/TR]
[TR]
[TD]A
[/TD]
[TD]GL44
[/TD]
[TD="align: right"]50
[/TD]
[/TR]
[TR]
[TD]A
[/TD]
[TD]GL73
[/TD]
[TD="align: right"]50
[/TD]
[/TR]
[TR]
[TD]A
[/TD]
[TD]GL74
[/TD]
[TD="align: right"]30
[/TD]
[/TR]
[TR]
[TD]B
[/TD]
[TD]GL43
[/TD]
[TD="align: right"]200
[/TD]
[/TR]
[TR]
[TD]B
[/TD]
[TD]GL44
[/TD]
[TD="align: right"]50
[/TD]
[/TR]
[TR]
[TD]B
[/TD]
[TD]GL73
[/TD]
[TD="align: right"]100
[/TD]
[/TR]
[TR]
[TD]B
[/TD]
[TD]GL74
[/TD]
[TD="align: right"]100
[/TD]
[/TR]
[TR]
[TD]C
[/TD]
[TD]GL43
[/TD]
[TD="align: right"]50
[/TD]
[/TR]
[TR]
[TD]C
[/TD]
[TD]GL44
[/TD]
[TD="align: right"]100
[/TD]
[/TR]
[TR]
[TD]C
[/TD]
[TD]GL73
[/TD]
[TD="align: right"]50
[/TD]
[/TR]
[TR]
[TD]C
[/TD]
[TD]GL74
[/TD]
[TD="align: right"]75
[/TD]
[/TR]
[TR]
[TD]D
[/TD]
[TD]GL43
[/TD]
[TD="align: right"]300
[/TD]
[/TR]
[TR]
[TD]D
[/TD]
[TD]GL44
[/TD]
[TD="align: right"]300
[/TD]
[/TR]
[TR]
[TD]D
[/TD]
[TD]GL73
[/TD]
[TD="align: right"]250
[/TD]
[/TR]
[TR]
[TD]D
[/TD]
[TD]GL74
[/TD]
[TD="align: right"]500
[/TD]
[/TR]
</tbody>[/TABLE]
Thanks in advance