Appreciate advice on how to count *backwards* the number of blank cells in excel column until a number reached

For example, there is a number 12 in cell N23, and I want to count backwards from cell N30, so I entered the following formula:

= MATCH (12, N30:N1,0)

Note that the range of cell to look up is entered in the reverse order (N30:N1), but not the other way round (N1:N30), the intention is to have the formula return “8” , which is the number of cells counted *backwards* from cell N30 until N23, when the number 12 reached.

However, the formula return “23” all the same, which is the number of cells counted forward from cell N1 until number 12 reached.

Is there anyway to achieve our objective?

Thanks for advice.