It can be devilishly tricky to get the formatting correct, but once you understand the key formatting parts it is straightforward and useful in many situations not only where you are starting with a text file of points, but also in converting between polyline, point and polygon shape formats in many cases simply by changing the header (e.g. "Polygon" to "Polyline").
For a polygon the key aspects of the text file are like those in the pasted in file below (and attached), including repeating the first point at the end of the cycle of coordinates in the table for the vertices to close the polygon. The example below is a Polygon with ZM coordinate set to 0.0 and with an "interior ring" created from the shapes shown in the polygon8 image using the WriteFeaturesToTextFile script; also in Samples.
If you are going straight from a spreadsheet writing the coordinates from just make sure you clone the general formatting shown (delete the interior ring and its vertices) including ensuring that you have no hanging spaces at the ends of lines.