View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Read Matrix via function

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

"Dan" wrote:

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