I'll outline an answer with a different example, rather than in terms of the specific details of this question.
A p-value ...
[...] is the probability of obtaining the observed sample results, or "more extreme" results, when the null hypothesis is actually true (where "more extreme" is dependent on the way the hypothesis is tested)
In your particular case, the more extreme cases are the ones more consistent with the alternative.
Let's say we have a sample mean of 5.347, and $\mu_0=2.5$
The z-statistic is $Z=\frac{\bar{x}-2.5}{5/\sqrt{10}}=1.8$
If the true population mean was 2.5 (i.e. the equality null), and we have the assumed normal distribution and the specified value for $\sigma$, then:
(a) the data should be normally distributed with mean $2.5$ and s.d. $5$ -- i.e. it should have this density:
(b) the sample mean should be normally distributed with mean $2.5$ and s.d. $5/\sqrt{10}$, so it should have this density:
(c) the standardized sample mean $Z=\frac{\bar{x}-2.5}{5/\sqrt{10}}$ should represent a single draw from a standard normal distribution:
(1) Under the equality null, $\mu=\mu_0$; , the alternative is values not equal to $\mu_0=2.5$ (values of the sample mean most suggestive of the alternative are values far from 2.5 in either direction). The probability of a result at least as extreme as the one observed (i.e. away from 2.5 in either direction) corresponds to values in this shaded region, and the probability is the shaded area:
As for how you compute this probability, the precise steps involved depend on what tables you have or what software you use.
(2) In the case of the one-sided null $\mu\leq \mu_0$, the alternative would be values greater than $\mu_0$, so the p-value is the area in the tail to the right of the observed statistic:
(3) In the case of the one-sided null $\mu\geq \mu_0$, the alternative would be values less than $\mu_0$, so the p-value is the area in the tail to the left of the observed statistic:
Here's a set of data consistent with the above sample mean if you want to start with some data:
-0.075 4.476 -1.899 4.390 7.851 5.076 6.673 8.811 6.614 11.555
(This is the data depicted in the first plot)
Without further context it would be hard to answer, because there are several variants of $t$-test (one sample, for independent samples with equal, or unequal variance, for dependent samples, etc.). Nonetheless, $t$ statistic and degrees of freedom are defined in terms of things like mean, standard deviation, and number of samples for both groups, where the formulas for calculating them can be found in statistics handbooks, and many places on web, including Wikipedia. I'd recommend you find the appropriate variant of the $t$-test that you are using (are you sure that the spreadsheet calculates the correct one for you?) in Wikipedia's article and calculate it by hand, you need nothing more then the pocket calculator for this.
Best Answer
I'm guessing (hoping) this is a one-sided one-sample t test, where the 'gain' for the $i$th subject is a difference $d_i$ and the test statistic is $t = \bar d \sqrt{n}/S_d,$ in which $\bar d$ and $S_d$ are the mean and standard deviation, respectively, of the $n$ differences.
Let $\delta$ be the population mean of $d_i$. Then one would reject $H_0: \delta = 0$ against $H_a: \delta > 0,$ for sufficiently large $t.$ The P-value, would be the probability under the density curve of Student's t distribution with $n -1$ degrees of freedom beyond the observed $t$ statistic. If $T$ is a random variable with that distribution then the P-value $p$ is $P(T > t)$. That is, $1 - p = P(T \le t).$
The value $t$ you wish to reclaim from the reported $p$ is then the inverse CDF (quantile) function of $1 - p$. For example, if $n = 16,$ and $p = 0.037,$ then we could use statistical software to obtain $t = 1.92$. In R, the code
qt(1-.037, 15)
returns 1.920596.A difficulty may be that P-values are not reported to many decimal places, especially when $p$ is too large to lead to rejection of $H_0$ at some significance level such as 5%. As a 'reality check', in my example, the critical value for a 5% level test (separating acceptance and rejection regions) is given by R code
qt(.95, 15)
which returns 1.753050 (probably 1.753 in a printed t table).Possible difficulties: (a) Your retrieved values of observed $t$ might be only approximate if $p$ is rounded. In the example above, if the P-value is reported as $p = .04$, my suggested procedure gives $t = 1.88$. (b) You must know $n$ to get the degrees of freedom. Or, if $n$ is very large, you might get a useful approximation from standard normal tables. (c) If the alternative is the two-sided $H_a: \delta \ne 0$, then that alternative will be rejected for large $|t|$ and you won't be able to know whether the observed $t$ is positive or negative. (d) If this is a two-sample t test, you can still retrieve $t$, provided you know the degrees of freedom. (For the pooled version of the test $DF = n_1 + n_2 - 2$, but for the Welch (separate-variances) version you would need to find $DF$ via a formula that involves both the two sample sizes $n_1$ and $n_2$ and the standard deviations of the two samples, which I'm guessing will not be reported if $t$ isn't.