dcofer
Board Regular
- Joined
- Jun 25, 2004
- Messages
- 203
Hello All,
I am using the formula below to lookup a price based upon two variables, the type of wood, and the size of the pieces.
The type of wood that is being looked up is in cell G21 and there are seven possible types (Ali Posts, Ironbark, Kwila, etc.) and the size to be looked up is in G22. Based upon the type of wood, there are different sizes available. As you can see from the ranges, one wood type only has 4 sizes, one has 9 sizes and the others have 10 sizes. To complicate matters even more, the ranges of data that contains the wood type, sizes, and prices are in separate areas. The prices are not contained in one large table or range. For example, the prices for Ironbark are in D28 to E37 on a seperate sheet and the prices for Redwood are in L28 to M36.
The formula below works perfectly, but it is very long and convoluted. Is there a simplier way to look up the prices? Perhaps with a shorter formula?
I tried to make the ranges of prices a table, but since there are blank rows (because all types of wood do not have 10 sizes), the data would not go into a table, and a Pivot Table was not possible for the same reason.
If anyone knows a better way to accomplish the lookup, I would appreciate it. Again, this formula works, but I am looking for a simplier formula, if one exists.
=IF(G21="Ali Posts",VLOOKUP(G22,Sheet2!B28:C31,2,0),IF(G21="Ironbark",VLOOKUP(G22,Sheet2!D28:E37,2,0),IF(G21="Kwila",VLOOKUP(G22,Sheet2!F28:G37,2,0),IF(G21="Merbau",VLOOKUP(G22,Sheet2!H28:I37,2,0),IF(G21="Radiata Pine",VLOOKUP(G22,Sheet2!J28:K37,2,0),IF(G21="Redwood",VLOOKUP(G22,Sheet2!L28:M36,2,0),IF(G21="Steel",VLOOKUP(G22,Sheet2!N28:O37,2,0))))))))
Thanks,
David
I am using the formula below to lookup a price based upon two variables, the type of wood, and the size of the pieces.
The type of wood that is being looked up is in cell G21 and there are seven possible types (Ali Posts, Ironbark, Kwila, etc.) and the size to be looked up is in G22. Based upon the type of wood, there are different sizes available. As you can see from the ranges, one wood type only has 4 sizes, one has 9 sizes and the others have 10 sizes. To complicate matters even more, the ranges of data that contains the wood type, sizes, and prices are in separate areas. The prices are not contained in one large table or range. For example, the prices for Ironbark are in D28 to E37 on a seperate sheet and the prices for Redwood are in L28 to M36.
The formula below works perfectly, but it is very long and convoluted. Is there a simplier way to look up the prices? Perhaps with a shorter formula?
I tried to make the ranges of prices a table, but since there are blank rows (because all types of wood do not have 10 sizes), the data would not go into a table, and a Pivot Table was not possible for the same reason.
If anyone knows a better way to accomplish the lookup, I would appreciate it. Again, this formula works, but I am looking for a simplier formula, if one exists.
=IF(G21="Ali Posts",VLOOKUP(G22,Sheet2!B28:C31,2,0),IF(G21="Ironbark",VLOOKUP(G22,Sheet2!D28:E37,2,0),IF(G21="Kwila",VLOOKUP(G22,Sheet2!F28:G37,2,0),IF(G21="Merbau",VLOOKUP(G22,Sheet2!H28:I37,2,0),IF(G21="Radiata Pine",VLOOKUP(G22,Sheet2!J28:K37,2,0),IF(G21="Redwood",VLOOKUP(G22,Sheet2!L28:M36,2,0),IF(G21="Steel",VLOOKUP(G22,Sheet2!N28:O37,2,0))))))))
Thanks,
David