This is an example of part of the start of one of your files
!Date: Sunday, January 29, 2023 12:50:38
!S2P File: Measurements: S11, S21, S12, S22:
# Hz S dB R 50
300000 -18.862196 4.9757056 -1.0350283 -0.70020109 -1.0443226 -0.70608562 -18.841742 5.5203471
11549625 -18.507008 1.060286 -1.1138686 -1.1768543 -1.1045679 -1.0994619 -18.402775 0.8063547
22799250 -18.426577 2.0101566 -1.1181669 -2.1032612 -1.1124948 -2.1241975 -18.416607 1.4881673
34048875 -18.370947 2.3688161 -1.1192718 -3.210099 -1.1200194 -3.2442918 -18.300875 2.537688
...
You have a row per frequency (first row 300 kHz, next row 11.5 MHz etc) of 4 columns of S parameters, in the order S11, S21, S12, S22, in dB/angle format.
This representation is not suitable for averaging as it's non-linear, the scale varies with radius. They must be converted to complex numbers, using the standard trig conversion \$Z = a.cos(theta) + j.a.sin(theta)\$, where \$a = 10^{\frac{dB}{20}}\$
Taking a worked example of S11 at 300 kHz, this means a = 0.11399615, so Z = 0.113566 + j0.009887.
I'm not sure what you want to average with what (between files, or over a small range of frequencies (but a curve fit might be a better operation)), but, do this to all the measurements, add them together as complex numbers, divide by the number of measurements you have added together, and the result is the average. You will probably want to transform the average from complex to dB/angle at the end for more familiar units.
Use your favourite computing tool. Excel will manage it happily, I'd use python, Matlab would be fine, almost any other language that can read text files would do. Beware that the angles in the s2p file are in degrees, and most implementations of trig functions want them in radians.