View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Match, Index, If

Try this...

A2:A5 = city
B2:B5 = status
D1:F1 = 1,2,3
D2:F5 = values

Input cells:

A10 = city
B10 = status
C10 = 1, 2 or 3

=SUMPRODUCT(--(A2:A5=A10),--(B2:B5=B10),INDEX(D2:F5,,C10))

--
Biff
Microsoft Excel MVP


"Shortstopper00" wrote in message
...
I'm making a user based questionaire. I need them to input 4 different
variables and based on those variables I need a single number to be picked
out of an index. I'm not exactly sure how the code would look. Here is an
example of what I am trying to do. The city, sunny or cloudy, month and
time
(1,2,3) are the variables.

1 2 3
Toronto Sunny Jan 4.5 5.7 6.7
Toronto Cloudy Jan 34 3 12
Ottawa Sunny Jan 23.5 45 14
Ottawa Cloudy Jan 32 4.8 54