if (strtofloat(StringGrid1.Cells[i,j])=pr) then begin result:=strtofloat(StringGrid1.Cells[i,1])+strtofloat(StringGrid1.Cells[1,j]); end