In Excel 2010, the Ztest function has been replaced by the Z.Test function.
Although it has been replaced, the Ztest function has been kept in Excel 2010, (stored within the list of compatibility functions), to allow compatibility with earlier versions of Excel.
However, the Ztest function may not be available in future versions of Excel, so it is advised that you use the Z.Test function if possible.
For a supplied hypothesized sample mean and a supplied set of values, the Excel Ztest function calculates the onetailed probability value of the ZTest.
I.e. the function returns the probability that the supplied hypothesized sample mean is greater than the mean of the supplied data values.
The syntax of the Ztest function is:
where the function arguments are:
array    The set of values against which the hypothesized sample mean is to be tested. 
x    The hypothesized sample mean. 
[sigma]   
An optional argument that represents the population standard deviation, if this is known. If omitted, the calculation uses the sample standard deviation. 
If you want to calculate the twotailed probability value of the ZTest, this can be done by using the Ztest function, combined with the Excel Min function, as follows:
A  B  

1  4  =ZTEST( A1:A12, 5 ) 
2  5  =ZTEST( A1:A12, 6 ) 
3  2  
4  5  
5  8  
6  9  
7  3  
8  2  
9  3  
10  8  
11  9  
12  5 
Column A of the above spreadsheet on the right contains an array of 12 data values. The mean of these values is 5.25.
Cells B1 and B2 of the example spreadsheet show the Excel Ztest function used to calculate the onetailed probability value of the ZTest for two different hypothesized sample means.
For the hypothesized sample mean 5.0, the onetailed probability value of the ZTest is calculated by the formula:
which gives the result 0.371103279.
For the hypothesized sample mean 6.0, the onetailed probability value of the ZTest is calculated by the formula:
which gives the result 0.838129187.
Note that in the above two examples, the [sigma] argument is omitted from the function. Therefore, the Ztest function calculation uses the standard deviation of the supplied array as the population standard deviation.
For further details and examples of the Excel Ztest function, see the Microsoft Office website.
If you get an error from the Excel Ztest Function, this is likely to be one of the following:
#N/A    Occurs if the supplied array is empty. 
#NUM!    Occurs if the [sigma] argument is supplied and is equal to zero. 
#DIV/0!   
Occurs if either:

#VALUE!    Occurs if either the supplied x or the supplied [sigma] is nonnumeric. 