ER Diagrams in Excel: Step-by-Step Guide
In this article
You can build a clear entity-relationship (ER) diagram in Excel without any diagramming add-in. Draw entities as rectangles, one per table, list their attributes as text inside or beside each box, and connect them with connector lines labelled with the relationship type (one-to-many, one-to-one, many-to-many). The result is a readable picture of your database schema that you can keep beside your table design, edit as the schema changes, and store in the same workbook as your data dictionary. Excel is not a modelling tool, so the diagram is a drawing rather than a live object, but for most small and mid-sized schemas that is enough.
What You'll Need
- A current desktop version of Excel for Windows or Mac. The Shapes and connector tools used here are not available in the browser version or the mobile apps, so do the drawing on a computer.
- A blank worksheet, or a workbook with a separate sheet reserved for the diagram. A sheet with many rows of data makes positioning boxes harder.
- A written list of your entities (tables), attributes (columns) and the relationships between them, even if it is rough notes. Drawing first and thinking later is what produces wrong diagrams.
- Optionally a second worksheet for a data dictionary: entity name, attribute name, data type, key or not, and a short description. This is where you can put detail you cannot fit into the boxes.
Step-by-Step
- Write down the entities before you draw anything. On paper or in a scratch column, list each real-world thing the system stores: Customer, Order, Product, Invoice, Address. Each becomes one rectangle. Check that each noun really holds data of its own rather than being an attribute of something else (a phone number belongs inside Customer, not as its own box).
- Open a new worksheet and turn on a grid. Use View > Gridlines to keep the grid visible, and consider View > Page Break Preview later if you plan to print. Gridlines help you align boxes.
- Draw the first entity. Go to Insert > Shapes and choose the rectangle. Drag on the sheet to draw a box roughly two to four columns wide, depending on how many attributes it holds. A taller, narrower box reads better than a very wide one.
- Label the box and style it once. Double-click the shape and type the entity name in the singular (Customer, not Customers). Set the text bold, centre it, and give the box a light fill from Shape Format > Shape Fill. Copy this styling to every entity so the diagram stays consistent.
- Add the attributes. Use Insert > Shapes > Text Box to place a small text box under the shape with the attribute list, one per line. Mark the primary key with
PKand foreign keys withFK, for example "CustomerID (PK)". Keeping attributes in a text box rather than inside the rectangle lets you grow the list without redrawing the shape. If the list is long, show only keys and the two or three important attributes in the diagram and put the full list in the data dictionary sheet. - Repeat for every entity and lay them out in rows. Group related entities together on the sheet. Leave two to three columns of white space between boxes so connector lines have somewhere to run. If you need to move a shape and its attribute text together, select both (click the shape, then Ctrl+click the text box) and use Shape Format > Group.
- Connect entities with connector lines, not plain line shapes. Go to Insert > Shapes and pick Elbow Connector under Lines. Hover over an entity box until the connection dots appear and drag from one dot to the dot on the second entity. Connectors stay attached when you move a box, unlike a free-floating line. On a Mac, the same connector shapes are in Insert > Shapes.
- Set the line ends to show relationship direction. With the connector selected, open Shape Format > Shape Outline > Arrows and pick a one-way or two-way arrowhead as appropriate. Use a plain line for one-to-many where the label carries the meaning, or an arrowhead pointing from the "one" side to the "many" side.
- Label the relationship. Double-click the connector and type a short verb phrase, such as "places" from Customer to Order and "contains" from Order to Product. Add the cardinality separately, either in the same label ("1 to many") or beside the connector ends using small text boxes with "1" and "N" or "1" and "M". A common convention is one line for "one" and a crow's foot drawn with small lines for "many", but text is faster and just as clear in a spreadsheet.
- Resolve many-to-many links. A many-to-many relationship (an Order holds many Products, each Product appears in many Orders) cannot exist as a plain column pair in a relational table. Create a junction entity such as OrderLine between them, with its own key and foreign keys to both parents, and draw two one-to-many connectors instead. This is the step most diagrams skip, and it is the one that makes the diagram match the actual schema.
- Align and tidy. Select all the shapes (Ctrl+A on a sheet with only diagram objects, or click each while holding Ctrl), then use Shape Format > Align to align left edges or tops. Shape Format > Distribute Horizontally or Vertically evens the gaps. Consistent alignment is what separates a diagram from a pile of boxes.
- Annotate anything that is not obvious. Add text-box notes for rules you cannot show: "an order must have at least one line", "email is unique", "status is one of New, Paid, Cancelled". Put a small legend in one corner explaining PK, FK, 1 and M. Record the diagram version and the date in a cell above the drawing.
- Set the print area and save. Select only the shapes, go to Page Layout > Print Area > Set Print Area, choose Landscape orientation, and check with File > Print that the diagram fits on one page. Save the workbook, and use Save As to keep a dated copy if the schema changes often.
Common Mistakes
- Using plain rectangles and stuck-on lines. A line drawn next to a box looks connected but is not. When you later move the entity the line stays behind. Always use connectors anchored to the shape's connection dots.
- Turning attribute lists into entities. Status values, phone numbers and addresses are usually columns, not tables. Promoting them balloons the diagram and confuses the design.
- Leaving many-to-many relationships unresolved. Two arrows saying "many" in both directions will not translate into real tables. Add the junction entity.
- No keys marked. A diagram with no \(PK\) and \(FK\) markers does not show how tables join, which is the main reason to draw an ER diagram at all.
- Drawing on the data sheet. Shapes drift when rows are inserted or filtered. Keep the diagram on its own sheet.
- Naming inconsistently. Mixing Customer, customer, and Cust_Table across entities and relationships makes the diagram harder to read than a plain list. Pick one naming style and stick to it.
Tips
- Hold Alt while dragging a shape to snap it to the cell grid on Windows; on Mac, press Cmd while dragging. This makes alignment almost automatic.
- Build one reusable entity box, style it, then copy and paste it for the others and retype the text. Copying preserves font, fill and border settings.
- Use colour sparingly and with meaning: one colour for core entities, another for junction tables. Avoid decoration-only colour.
- When the diagram grows past one screen, split it into subject areas on separate worksheets (sales, inventory, billing) and add a small overview sheet showing how they connect.
- If your organisation has Visio or a database tool, export or redraw there for large schemas. Excel is excellent for sketches and small models, not for hundreds of entities.
- Keep the data dictionary sheet open while drawing. It forces you to define data types and lengths, which quickly expose missing or duplicated attributes.
Troubleshooting
- Connectors will not attach. The shape may be a text box or grouped object. Convert it to a real shape (Insert > Shapes > Rectangle), or select the group and ungroup it before attaching.
- Text overflows the box. Increase the shape size, reduce the font size, or move the attribute list into a separate text box. Also check Format Shape > Text Options and turn off wrap if you are using short labels.
- Shapes jump when you move them. Alt or Cmd snapping is pulling them to cell boundaries. Release the key, or hold the modifier deliberately to place boxes precisely.
- The diagram breaks across printed pages. Reselect the print area, switch to landscape, and choose Fit Sheet on One Page under Page Setup. If it still splits, scale down with View > Zoom and redraw slightly more compactly.
- A connector points the wrong way. Select it and use Shape Format > Shape Outline > Arrows to change the arrowhead end, or delete and redraw from the correct connection dot.
- Shapes are hard to select. Use Home > Find & Select > Selection Pane to see every object on the sheet by name and hide or show them individually.
Frequently Asked Questions
Can I make an ER diagram in Excel without an add-in?
Yes. The built-in Shapes and connector tools are enough. No add-in or external tool is required for a basic ER diagram.
Does Excel create the tables from the diagram?
No. In Excel the diagram is a drawing, so it is documentation rather than a generating tool. You build the tables yourself, guided by the diagram and the data dictionary.
What is the difference between an ER diagram and a spreadsheet table?
The ER diagram shows structure: entities, attributes, keys and relationships. The worksheet table holds the actual rows. Keeping both in the same workbook makes the design and the data easy to compare.
How do I show one-to-many and many-to-many relationships?
Label a connector between two entities "1 to many" for one-to-many. For many-to-many, add a junction entity between them and draw two one-to-many connectors.
Should I use Excel or a dedicated diagramming tool?
Excel suits small schemas and quick sketches, especially when the diagram must live beside your data. For large schemas with many entities, a dedicated modelling or diagramming tool will be faster and less error-prone.