Tabellab
Excel formulas

Shoelace formula in Excel: the area of a polygon from its coordinates

The shoelace formula gives the area of any simple polygon from the coordinates of its corners: list the vertices in order, multiply each x by the next y and subtract each next x times this y, add up the results and halve the absolute value. In Excel it fits in one cell: =ABS(SUMPRODUCT(B2:B7,C3:C8)-SUMPRODUCT(B3:B8,C2:C7))/2. For the six-corner building plot in the worked example below the area is 1,344 m², with a perimeter of 139.51 m. This guide shows the formula row by row, in one cell and as a LET formula that needs no repeated first corner.

Updated 21 Oct 2026 5 min read By Tabellab team

The shoelace formula

Area = ½ × |Σ (xᵢ · yᵢ₊₁ − xᵢ₊₁ · yᵢ)|

The vertices (x₁, y₁) … (xₙ, yₙ) must be listed in order around the shape, and the last one connects back to the first, so after the last vertex the "next" point is vertex 1 again. Writing the products crosswise between two columns looks like lacing a shoe, hence the name. Mathematicians also call it Gauss's area formula or the surveyor's formula. It works for any polygon whose edges do not cross, convex or not, with any number of corners.

Row by row in Excel

Put the vertices in B2:C7 and repeat the first vertex in row 8 (=B2 and =C2), so the last edge has a "next" row too. In D2, the cross term of the first edge is =B2*C3-B3*C2: this row's x times the next row's y, minus the next row's x times this row's y. Fill it down to D7. The cross terms of the plot are −30, 846, 1,035, 711, 162 and −36, and their sum is 2,688. Half of the absolute value is the area: 1,344 m². The helper column makes it easy to check each edge, which is useful when a surveyor's list has a typo.

Worked example: the area of a six-corner building plot

Corner coordinates in metres from a site plan, listed anticlockwise. Row 8 repeats the first corner to close the shape. Column D holds the cross terms and column E the length of each edge.

Worked example: the area of a six-corner building plot
ABCDE
1Vertexx (m)y (m)Cross termEdge length (m)
2P121-3036.12
3P238484624.04
4P345271,03520.52
5P4304171121.59
6P593616220.12
7P6018-3617.12
8P1 again (closes the shape)21
9
10Sum of the cross terms (signed, ×2 area)2,688
11Area row by row: |sum| ÷ 2 (m²)1,344
12Area in one formula with SUMPRODUCT (m²)1,344
13Area without the repeated row: LET + VSTACK (m²)1,344
14Perimeter (m)139.51
15Area in hectares0.1344
16Check: bounding rectangle 45 m × 40 m (m²)1,800
Key formulas
  • D2=B2*C3-B3*C2Cross term of edge P1 → P2
  • D11=ABS(D10)/2Area from the helper column
  • D12=ABS(SUMPRODUCT(B2:B7,C3:C8)-SUMPRODUCT(B3:B8,C2:C7))/2Area in one cell
  • D13=LET(x,B2:B7,y,C2:C7,nx,VSTACK(DROP(x,1),TAKE(x,1)),ny,VSTACK(DROP(y,1),TAKE(y,1)),ABS(SUMPRODUCT(x,ny)-SUMPRODUCT(nx,y))/2)No repeated row needed

A fictional plot. Coordinates on a flat grid, for example from a site plan or a projected map in metres.

In one cell with SUMPRODUCT

The sum of the cross terms is the same as Σxᵢyᵢ₊₁ − Σxᵢ₊₁yᵢ, and each of those is a SUMPRODUCT of two ranges shifted by one row against each other:

=ABS(SUMPRODUCT(B2:B7,C3:C8)-SUMPRODUCT(B3:B8,C2:C7))/2

B2:B7 with C3:C8 pairs every x with the next y, and B3:B8 with C2:C7 every next x with this y. Both ranges in each SUMPRODUCT must have the same number of rows, six here, and the repeated vertex in row 8 closes the shape.

Without the repeated vertex: LET and VSTACK

With dynamic arrays (Microsoft 365, Excel 2024) you can build the "next vertex" columns inside the formula: VSTACK(DROP(x,1),TAKE(x,1)) moves the first value to the end. Wrapped in LET:

=LET(x,B2:B7,y,C2:C7,nx,VSTACK(DROP(x,1),TAKE(x,1)),ny,VSTACK(DROP(y,1),TAKE(y,1)),ABS(SUMPRODUCT(x,ny)-SUMPRODUCT(nx,y))/2)

It returns the same 1,344 m² from the six corners alone, and you only change two ranges for a polygon with more corners. The LAMBDA guide shows how to save a formula like this as your own function, for example PolygonArea(x, y).

Clockwise, anticlockwise and units

  • Direction: anticlockwise order gives a positive sum, clockwise a negative one. The size is the same, so ABS makes the order irrelevant. The sign is still useful: it tells you which way the points run.
  • Order matters: the corners must follow the outline. Shuffled corners make the edges cross and the result is wrong, without any error message.
  • Units: coordinates in metres give square metres. Divide by 10,000 for hectares (0.1344 ha here). On a drawing at a scale of 1:500, multiply an area measured in drawing units by 500².
  • Latitude and longitude: convert them to a projected grid in metres first. Degrees are not equal distances, as the haversine guide explains.

Checks and the centroid

A quick sanity check is the bounding rectangle: the plot spans 45 m × 40 m, 1,800 m², so 1,344 m² is plausible. Test the formula on a shape you know, such as a 10 × 10 square (100). The same cross terms also give the centroid, the balance point of the area: Cx = Σ (xᵢ + xᵢ₊₁) · crossᵢ ÷ (6A) and Cy = Σ (yᵢ + yᵢ₊₁) · crossᵢ ÷ (6A), with the signed area A. It is not the average of the corners.

Common mistakes

  • Corners out of order. The vertices must follow the outline. Jumping across the shape creates crossing edges and a wrong area.
  • Not closing the polygon. Without the last edge back to the first corner the sum misses one cross term. Repeat the first vertex or use the LET version.
  • Forgetting ABS. Clockwise corners give a negative sum. Take the absolute value before halving it.
  • Forgetting to halve. The sum of the cross terms is twice the area.
  • Shifted ranges of different sizes. SUMPRODUCT(B2:B7,C3:C9) returns #VALUE!. Both ranges must have the same number of rows.
  • Using latitude and longitude directly. Degrees are not metres. Project the coordinates first.

Frequently asked questions

What is the shoelace formula?

It is a formula for the area of a simple polygon from its vertex coordinates: half the absolute value of the sum of xi·yi+1 − xi+1·yi over all edges, with the last vertex connected back to the first.

Does the shoelace formula work for concave polygons?

Yes, for any polygon whose edges do not cross each other, convex or concave. For a self-intersecting shape, such as a figure eight, the result is not the enclosed area.

Why is my shoelace area negative?

The vertices are listed clockwise. The size is correct, only the sign is reversed, so wrap the sum in ABS before halving it.

How do I calculate polygon area in Excel?

List the corners in order in two columns, repeat the first corner at the end and use =ABS(SUMPRODUCT(B2:B7,C3:C8)-SUMPRODUCT(B3:B8,C2:C7))/2, adjusting the ranges to the number of corners.

Practise it in a lab

Related guides

Reading is step one. Doing is step two.

Every guide links to a lab where you build the same calculation in an online spreadsheet and get instant feedback.

Open the lab