View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
smartin smartin is offline
external usenet poster
 
Posts: 915
Default vlookup with if statement - Excel 2003

murkaboris wrote:
Hello:

I have a worksheet with the following columns:

ID Angio AW CT Mammo MR NUC IIS
403 1200.0 379.0 1890.0 338.7 2267.0 220.0 1800.0
399 0.0 466.5 3000.0 301.2 3800.4 200.3 1200.0
406 0.0 207.6 1853.0 330.0 1762.0 300.0 2300.0
408 0.0 308.0 1082.1 288.0 1221.7 264.4 2257.5
407 0.0 570.0 3050.0 630.0 3200.0 300.0 2200.0
404 1000.0 382.0 1780.0 300.0 2200.0 320.0 800.0

I need to lookup the territory ID and then return the value in the columns
based on their column header (Angio, AW, Ct, etc...) in the following format
on another worksheet:

403 2009 OP
CT
MR
Mammo
RAD


Hi Monika,

A combination of INDEX and MATCH can do this. Assume your first table is
cornered at Sheet1 A1:H7 and the lookup area is at Sheet2 A1:Axx, then
put the following formula in Sheet2 B2 and fill down. Sorry this will
probably suffer line wrap in this post:

=INDEX(Sheet1!$B$2:$H$7,MATCH(Sheet2!$A$1,Sheet1!$ A$2:$A$7,0),MATCH(Sheet2!$A2,Sheet1!$B$1:$H$1,0))