A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
If you were to use just the matrix, won't you get the correct value each time?
I think using the numbers as a factor is introducing the problem, because a 4 can be the result of three different constellations and only two of them are medium, according to the matrix. Therefore, the IF formula does no good.
So, use the Index/Match formula to query the matrix based on the text values for likelihood and impact, and the result should be correct. You can still calculate and show the number, but the number alone will not give the correct risk rating.