Read Matrix via function

D

Dan

Hi,
I have a matrix as follow

Name/Grade Dan Ben Dave Laura
Math A A+ C A
English B A B A+

How can I have a VBA fuction that will read this matrix, for example

Name_Grade( Ben , English ) = "A"
Name_Grade( Dave , Math ) = "C"

Many thanks,
Dan
 
M

Mike H

Dan,

A formula is much simpler

=INDEX(A1:E20, MATCH(F1,A1:A20,0), MATCH(G1,A1:E1,0))

Where F1 is the subject and G1 is the name to lookup

Mike
 
P

Pilar Morales

Great formula! Does it work on Pivot tables- when the lookup value is in a
different sheet ? Does it require Ctrl+Enter?
Thanks (sorry to interrupt)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top