The countif function in column A only shows a number if the criteria are met.
Formula: copy to clipboard
=IF(COUNTIFS(B3,Results!$C$3,C3,Results!$D$3)=1,1+MAX($A$2:A2),"")

In basic terms, the formula above does the following: If both B3 = the selected program and c3 = the selected Theme, then add 1 to the max value in the rows above, so each match is a unique number(1,2,3,.....).
You can then find the cells you want using INDEX & MATCH, as you have unique identifiers for each row and column.

If it still doesn't make sense, do some research on the COUNTIFS and INDEX & MATCH functions.