How to average the last N row in Excel 2019 with blank cells

I’m trying to average the last N rows in Excel, but I have some blank (and merged) cells; in something like this:

Example

A
1
2
x
3
4
5
6
7
y
8
9
10

for example, wanting average the last four rows it should average A8 to A12 ignoring A9, which isn’t a number.

Moreover, new rows will be added, so the average needs to be dinamic, always taking the last N compiled rows with numbers.

I found some article like this on the topic, but they all assume consecutive data, without addressing the case of some blank/text cell amid the data; this answer seems to tackle the issue, but I wasn’t able to make those formulas work for me (and I’m not sure how to use that in the accepted answer, since it uses more than one column, while I only have one).

This and this too seems relevant too, but again I wasn’t able to make them work in my case.

Is there a way to do this?