Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Given a two-dimensional table with row and column headers, like this:

enter image description here

What is the formula to return the value at the intersection of a particular row and column? For example, I want a formula that would take "Blue" and 180 and return $2.20 in this case.

share|improve this question

1 Answer 1

up vote 4 down vote accepted
=INDEX($C$4:$E$9,MATCH(180,$B$4:$B$9,0),MATCH("Blue",$C$3:$E$3,0))

returns $2.20.

share|improve this answer
1  
Thanks! By naming the column headers "ColHeaders", the row headers "RowHeaders", and the data area "Data", I was able to write this as =INDEX(Data,MATCH(180,RowHeaders,0),MATCH("Blue",ColHeaders,0)) –  Joel Spolsky Jul 28 '11 at 18:19
    
Important to remember the non-optional third argument to MATCH which must be 0 for an exact match –  Joel Spolsky Jul 28 '11 at 18:20
    
@Joel Spolsky: You're more than welcome. –  Mehper C. Palavuzlar Jul 28 '11 at 19:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.