Hi, Im having probelms sorting the output of a match function, the output is correct but when sorted it seems to maintain the reference to the original cell.. Is this a bug?

The formula im using is

=OFFSET(KM!$A$1,MATCH('km mod'!A135,KM!$A$2:$A$554,1),MATCH('km mod'!$A$4,KM!$B$1:$T$1,1))

Any help much appreciated.