View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Glenn Ray[_3_] Glenn Ray[_3_] is offline
external usenet poster
 
Posts: 34
Default vlookup question

Assuming you're looking only for an exact match, the previously submitted
solutions (using INDEX and MATCH) will work.

However, your sizing chart looks similar to those used for window treatment
pricing (ex. blinds). In that case, you may need to price up to the next
size in case someone orders a non-standard size. For example, in your price
array, an object 54w by 72h would have a price of 310. But if they wanted
something 58w by 72h, the price should be for a 60w by 72h item, right?

If that assumption is true, you'd have to make two major changes:

1) Invert your array, so that heights descend in value (top to bottom) and
widths descend in value (left to right). Adjust your prices accordingly.

2) Using "toppers" example, label your height values "HeightArray"; your
width values "WidthArray" and your actual prices "PriceArray". If your input
cells are B1 for Height and B2 for Width, you'd change your price lookup
formula to like this:
=INDEX(PriceArray,MATCH(B1,HeightArray,-1),MATCH(B2,WidthArray,-1))

Note the "-1" condition; it looks for the smallest value greater than or
equal to your input variable.

-Glenn Ray


"JR Winder" wrote:

I'm trying to determine the price of item based on the size of that item.
Since I have 244 different sizes and prices, I was thinking the easiest way
to do this would be via vlookup. If there's an easier way, please don'
hesitate to tell me as I'm not at all familure with vlookup.

My spreadsheet looks like this: if you match the height of an item with it's
width, you get it's price. Example 12x12 = 42.00, 42x72=262.00,
78x24=211.00.

Can anyone help?

thanks

W I D T H
12 18 24 30 36 42 48 54 60 66 72 78 84 90 96
12 42 53 64 75 85 97 108 119 129 140 151 163 174 185 196
18 53 65 77 90 101 114 126 138 150 162 174 186 198 211 223
H 24 64 77 91 104 117 130 143 156 169 182 196 211 223 236 249
30 75 90 104 118 132 146 161 175 190 203 217 234 248 261 275
E 36 85 101 117 132 148 163 179 193 209 225 239 257 272 286 302
42 97 114 130 146 163 180 196 213 229 246 262 279 296 312 329
I 48 108 126 143 161 179 196 217 235 252 270 288 306 324 341 359
54 119 138 156 175 193 213 235 253 272 291 310 329 348 367 385
G 60 129 150 169 190 209 229 252 272 293 313 333 354 372 392 412
66 140 162 182 203 225 246 270 291 313 334 355 376 396 417 439
H 72 151 174 196 217 239 262 288 310 333 355 378 399 421 444 466
78 163 186 211 234 257 279 306 329 354 376 399 439 455 479 503
T 84 174 198 223 248 272 296 324 348 372 396 421 455 480 505 531
90 185 211 236 261 286 312 341 367 392 417 444 479 505 533 560
96 196 223 249 275 302 329 359 385 412 439 466 503 531 560 588
102 203 234 262 291 322 350 381 410 439 469 499 527 557 587 615
108 214 246 275 306 337 368 399 439 459 501 521 553 583 613 645