Excel Practice Test

โ–ถ

Learning how to make lines in Excel is one of those small skills that completely transforms the look of a spreadsheet. Whether you are building a budget, a class schedule, or a quarterly report that will sit next to a vlookup excel reference table, the difference between a polished workbook and a chaotic one usually comes down to deliberate use of borders, gridlines, and divider lines. This guide walks through every method Excel offers in 2026, from one-click borders to custom diagonal lines and sparklines that draw mini trend lines inside a single cell.

Excel actually supports several distinct kinds of lines, and treating them as interchangeable is the most common mistake new users make. Gridlines are the faint gray lines that separate every cell by default, but they only show on screen unless you tell Excel to print them. Borders are real, formatted lines that you draw onto specific cells. Sparklines are micro charts. Underlines apply to text inside a cell. Shapes let you draw freehand connector lines on top of a worksheet. Each behaves differently when you copy, print, or export.

Most readers landing here want one of three things: they need to add visible separators between rows and columns, they need to remove the default gridlines for a cleaner finished look, or they need to draw a custom diagonal line through a header cell to label two values at once. We will cover all three plus several advanced techniques like conditional border formatting, repeating header underlines on every printed page, and using sparklines to embed trend lines without leaving the worksheet.

The good news is that none of these techniques require a macro, an add-in, or a paid subscription. Every method described here works in Excel 2019, 2021, Microsoft 365, Excel for the web, and Excel for Mac, with only minor menu-position differences between platforms. The shortcuts work identically on Windows and Mac except for the Cmd versus Ctrl swap, and once you internalize the Borders flyout in the Home tab you will be styling tables in seconds.

Before we dive in, it helps to understand why this matters beyond aesthetics. A spreadsheet without clear visual structure forces the reader's eye to do extra work, and studies of dashboard usability consistently show that even thin one-pixel rules between sections reduce comprehension time by double-digit percentages. When you are presenting numbers to a manager, a client, or a teacher, the lines you draw quite literally guide them through your logic. Treat lines as a communication tool, not decoration.

Throughout this guide we will use a sample sales workbook with regions, months, and totals so you can follow along. If you want to test your knowledge as you go, try our practice quizzes linked at the bottom, including the full Excel certification practice test that covers formatting, formulas, and functions in a single timed assessment.

By the end of this article you will know how to add, remove, recolor, thicken, dash, diagonal, and conditionally apply lines to any cell or range. You will also know which method to choose for which situation, which is what separates spreadsheets that look amateur from ones that look professional.

Lines in Excel by the Numbers

๐Ÿ“‹
13
Border Presets
๐ŸŽจ
14
Line Styles
๐ŸŒ
56+
Color Choices
๐Ÿ“Š
3
Sparkline Types
โฑ๏ธ
2 sec
Fastest Method
Test What You Know About Lines in Excel โ€” Free Practice Quiz

Five Ways to Add Lines in Excel

๐Ÿ“‹

Select your range, open the Home tab, click the Borders dropdown arrow, and pick All Borders, Outside Borders, or Thick Box Border. This is the fastest way to add lines and works on any selection from a single cell to an entire table.

โœ๏ธ

Press Ctrl+1 to open Format Cells, switch to the Border tab, and click individual edges of the preview to add or remove specific lines. This gives pixel-level control including line style, color, and diagonal slashes.

๐ŸŽฏ

From the Borders dropdown, choose Draw Border or Draw Border Grid. Your cursor becomes a pencil and you literally trace lines onto the worksheet. Great for irregular shapes that do not match a clean rectangular range.

๐ŸŒ

Go to Insert, Shapes, and pick a straight line or arrow. The shape floats above cells rather than belonging to them, which is useful for annotations, callouts, and connecting two distant ranges visually on a dashboard.

๐Ÿ“Š

Select an empty cell, choose Insert, Sparklines, Line, and point at a row of data. Excel draws a miniature trend line inside that one cell, perfect for showing month-over-month patterns next to a totals column.

To make smart choices about lines you need to understand the three layers Excel renders on top of each other. The bottom layer is gridlines, the faint default lines that show every cell boundary. The middle layer is borders, which belong to cells and travel with them when you sort or filter. The top layer is shapes, which float independently. Knowing which layer you are working on prevents the most frustrating bug in spreadsheet formatting, which is when a line refuses to disappear no matter how many times you click Remove Border.

Gridlines are controlled from the View tab with the Gridlines checkbox. Turning them off across the entire sheet gives reports a clean, magazine-like finish, and it is almost always the right move before sharing a polished workbook. If you want gridlines hidden on screen but visible when printed, go to Page Layout and check Print under Gridlines. This pair of settings is independent, which surprises a lot of users who think the View toggle controls printing too.

Borders are where most of the action happens. When you select a range and apply All Borders, Excel adds a thin black line to every internal and external edge of every selected cell. The line lives with the cell, so if you cut and paste the range elsewhere the borders move with it. This makes borders the right choice whenever the lines are part of the data, like the rule between a header row and the first data row, or the heavy outline around a totals section that should always sit just below the values being summed.

The Format Cells dialog, opened with Ctrl+1, is the power user's tool. Inside the Border tab you can pick a line style first, then a color, and only then click the preview to apply that style to a specific edge. The order matters because Excel applies whatever style is currently selected, so if you pick the edges first and the style second nothing happens. Mac users sometimes miss this because the dialog layout differs slightly, but the logic is identical.

Shape lines are perfect when you need a connector that crosses many cells at an angle, like an arrow pointing from a callout box to a specific data point. Because shapes ignore cell boundaries you can draw them anywhere, but they also ignore sorting and filtering, so they will not follow rows around if your table changes. Use shapes for annotations that describe the worksheet, not for structural lines that should belong to the data itself.

Sparklines are technically a kind of line too, even though they are charts. A line sparkline draws a tiny trend line entirely within one cell, with optional markers for high and low points. Once you understand them you will find dozens of places to use sparklines instead of standalone charts. Many users build dashboards where every row has its own sparkline trend next to current values and percentage changes, all in a compact width that fits on one screen.

The last concept worth internalizing is that lines respond to row height and column width. A diagonal border drawn through a tall narrow cell looks almost vertical, while the same border drawn through a short wide cell looks almost horizontal. If you plan to print at a specific size, set your row heights and column widths first, then add borders last, otherwise everything will need adjustment after the layout changes.

FREE Excel Basic and Advance Questions and Answers
Practice borders, formatting, and core skills with realistic exam-style questions.
FREE Excel Formulas Questions and Answers
Quiz yourself on SUM, IF, VLOOKUP, INDEX/MATCH and other formula essentials.

Drawing Diagonal, Dashed, and Custom Lines

๐Ÿ“‹ Diagonal Lines

Diagonal lines are most often used in header cells where one row label and one column label need to share the same corner. Select the cell, press Ctrl+1, go to the Border tab, and click either the upper-left to lower-right or upper-right to lower-left diagonal button in the preview. You can then type both labels into the cell separated by spaces and use Alt+Enter to push the second label onto a new line.

To make the labels sit in opposite corners, increase the row height and column width, then use the Alignment tab to set the first label as top-left and the second as bottom-right. Many learners discover this trick when building schedules that cross days and times, similar to how a vlookup excel lookup table separates row keys from column keys. It is a small touch but instantly signals professional formatting.

๐Ÿ“‹ Dashed and Dotted Lines

Dashed and dotted borders are great for distinguishing subtotal rows from grand totals, or for showing that two areas are related but not contiguous. Open Format Cells, go to the Border tab, and in the Line section pick the dashed or dotted style before clicking the edge you want to apply it to. Excel offers about seven dashed variations including short dash, long dash, and dash-dot combinations for double emphasis.

A common pattern is a dashed line above a subtotal row and a solid double line above the grand total, which mirrors traditional accounting conventions. If you need to learn how to merge cells in excel for a wide header row that sits above a dashed divider, do the merge first and then apply the border, because merging after the fact can clear formatting on the now-removed cells underneath.

๐Ÿ“‹ Colored and Thick Lines

By default Excel borders are thin black, but you can change weight and color to create visual hierarchy. In Format Cells, choose a thicker style from the Line section, then click the color dropdown and pick a brand or theme color. Thick brand-colored borders work well for outer report frames, while thin gray internal borders keep the inside of the table from feeling busy.

For tables that will be exported to PDF, stick to high-contrast colors like dark gray, navy, or black for any line that carries meaning. Very light colors render unevenly across PDF readers and printers, so a chart that looks crisp on your monitor can come out faded on a colleague's screen. Test critical reports by exporting to PDF and viewing on a second device before sharing widely.

Borders vs Gridlines: Which Should You Use?

Pros

  • Borders travel with cells when sorted, filtered, or moved
  • Borders print by default with no extra setting changes
  • Borders support color, thickness, and dash styles
  • Borders can be applied conditionally with rules
  • Borders allow diagonal lines that gridlines cannot
  • Borders work in exports to PDF and image formats

Cons

  • Gridlines are faster โ€” no formatting needed at all
  • Gridlines stay perfectly aligned even after column resize
  • Gridlines never need to be reapplied after edits
  • Gridlines can be hidden globally with one checkbox
  • Gridlines do not interfere with conditional formatting colors
  • Gridlines are easier for beginners who fear menu navigation
FREE Excel Functions Questions and Answers
Practice questions on TEXT, DATE, LOOKUP, and statistical functions you use daily.
FREE Excel MCQ Questions and Answers
Multiple choice questions covering ribbons, shortcuts, formatting, and chart basics.

Pre-Print Line Checklist for Polished Worksheets

Turn off screen gridlines under View to preview the final look
Apply a thick outside border to the entire data range
Add a thin bottom border under the header row only
Use a double bottom border above the grand total row
Set all border colors to dark gray or black for print clarity
Remove stray borders left over from copy-pasted ranges
Confirm diagonal borders display correctly at current zoom
Check that merged-cell borders extend across the full merge
Verify sparklines appear in every intended row with no gaps
Print to PDF first and review every page before sending
Ctrl+Shift+& applies an outline border in under a second

Select any range and press Ctrl+Shift+& on Windows or Cmd+Option+0 on Mac to instantly add a thin outline around the selection. Pair this with Ctrl+Shift+_ to remove all borders. These two shortcuts alone will save you thousands of clicks across a year of Excel work.

Sparklines are the most underused line feature in Excel, and once you start using them you will wonder how you ever lived without them. A sparkline is a tiny chart that lives entirely inside a single cell, drawing a trend line from a row or column of source data. They were introduced in Excel 2010 and have been refined ever since, and in 2026 they still represent one of the cleanest ways to show pattern at a glance without burning vertical space on a full chart.

To insert a sparkline, click the cell where you want it to appear, go to the Insert tab, and choose Sparklines, then Line. A small dialog appears asking for the data range. Point to the row of numbers you want to plot, click OK, and a tiny line graph appears in your target cell. Drag the fill handle down to populate sparklines for every row in your table, and Excel automatically adjusts the source range for each row, just like a relative formula would.

The Sparkline Design tab, which appears whenever a sparkline is selected, gives you control over markers, colors, and axis behavior. Turning on the High Point and Low Point markers is almost always worth it because those two dots immediately tell the reader where peaks and troughs occurred. The Same for All Sparklines axis setting is critical when comparing rows โ€” without it, each sparkline scales independently and a flat line on one row looks identical to a wild swing on another, which is misleading.

Column sparklines plot bars instead of a line and are better for discrete monthly or quarterly comparisons. Win/Loss sparklines plot a small upward bar for positive numbers and a small downward bar for negative numbers, ignoring magnitude. Sales teams love win/loss for showing a streak of weekly results, while finance teams prefer line sparklines for showing smooth trends over time. Pick the type that matches the underlying data shape.

One gotcha worth knowing: sparklines do not appear in the formula bar like normal content, which means a casual viewer might not realize they are there. To make them obvious, give the sparkline column a clear header like Trend or Last 12 Months and use a slightly different background fill. This signals to the reader that the lines are meaningful and not just decorative.

For more advanced trend visualization you can combine sparklines with conditional formatting in adjacent cells. Imagine a row that shows current month sales, a sparkline of the last twelve months, the percent change versus last year, and a colored data bar showing relative size. That single row tells a story that would otherwise require three separate charts and a paragraph of commentary. Dashboards built this way are dense without being cluttered.

Finally, sparklines respect cell formatting in subtle ways. If you change row height the sparkline scales with it. If you merge cells, the sparkline expands across the merge. If you copy a sparkline to a new sheet, the source data reference may break, so always verify that copied sparklines still point to live data before sharing the workbook with stakeholders.

Even experienced Excel users run into recurring problems with lines, and most of them trace back to a handful of avoidable mistakes. The first is mixing borders and gridlines without realizing it. If you turn off gridlines but only apply borders to part of your data, the unbordered cells suddenly look like floating numbers with no structure. The fix is to either apply borders to the entire used range or leave gridlines on for the working sheet and only turn them off for the final printable version.

The second mistake is overusing thick or colored borders. A spreadsheet that uses bright red 3-point borders on every section starts to feel like a warning sign rather than a report. The strongest visual designs in Excel use exactly two border weights โ€” a thin one for internal divisions and a thick one for the outer frame โ€” and reserve color only for the very top edge or the grand total. Restraint communicates confidence.

The third mistake is applying borders before merging cells. If you merge a range that already has internal borders, Excel sometimes preserves those internal lines as ghost edges that show up only at certain zoom levels or in print preview. Always do your merging first and apply borders to the merged result. If you need to learn how to merge cells in excel quickly, the keyboard path is Alt-H-M-M on Windows.

A fourth issue is forgetting that conditional formatting can also apply borders. If a cell has a conditional rule that adds a red bottom border when a value drops below zero, and you do not realize the rule exists, you will see seemingly random borders appearing and disappearing. Always check Conditional Formatting Rules Manager before assuming a stray line is a bug. The same applies to table styles, which include their own border patterns that override manual borders.

A fifth common pitfall is exporting to PDF without checking line rendering. Some printer drivers thin out one-pixel borders to the point of invisibility, while others over-render them as dark bands. The cure is to set borders that matter to a slightly thicker weight, around 1.5 points, and to always preview the PDF before distribution. For learners just starting out, a great way to reinforce this is to take the free Excel functions practice quiz and then format your answer sheet with proper borders.

The sixth pitfall happens when you copy formatting from one workbook to another with different theme colors. A border that looked black in the source workbook may render as light blue in the destination because the underlying theme color is Accent 1, not actual black. To prevent this, use the standard color palette rather than theme colors for any border you want to look identical across workbooks. Theme colors are great for fills, less great for lines.

The seventh and final issue is line clutter on dashboards. When sparklines, conditional formatting, manual borders, table styles, and chart axes all compete for attention, the eye does not know where to land. Build dashboards by starting with zero lines, then add back only what is necessary. If a line does not help the reader make a decision, remove it. Less really is more in spreadsheet design.

Master Excel Formulas and Formatting โ€” Try the Free Formula Quiz

Now that you understand every method, here are practical tips that will make your line work look professional without taking extra time. First, build a personal style guide for your spreadsheets. Pick one thin gray color for internal borders, one darker color for outlines, and one accent color for grand totals. Save these as cell styles under Home, Cell Styles, New Cell Style. From that point forward you can apply a consistent look with a single click on any new workbook.

Second, leverage Excel Tables. When you convert a range to a Table using Ctrl+T, Excel automatically applies banded rows, header borders, and a consistent outer frame, and it maintains all of those as you add or delete rows. Tables also bring filters, structured references, and easier integration with Power Query. For most working data sets, starting with a Table is the right move before any manual border work even begins.

Third, learn the keyboard shortcuts and stop reaching for the mouse. Ctrl+Shift+& for outline border, Ctrl+Shift+_ to remove all borders, Ctrl+1 to open Format Cells, and Alt+H+B to open the Borders dropdown will cover ninety percent of your line work. Combine these with arrow keys and Shift to select ranges, and you can format a complex report in under a minute without ever touching the mouse.

Fourth, plan your borders to support filtering. If you put a thick border between Q1 and Q2 sections of a sales table, and then a user filters the table to show only one region, the visual separation can disappear because the filtered rows hide. For tables that will be filtered, prefer banded fill colors over hard borders to separate groups, because fills travel with visible rows correctly.

Fifth, consider accessibility. Very thin light gray lines may be invisible to readers with low vision or to printouts on lower-quality printers. If your spreadsheets are read by a wide audience, default to medium-weight darker borders. For colorblind-friendly design, never rely on color alone to convey meaning in a line โ€” pair color with thickness or style differences so the meaning still comes through in grayscale.

Sixth, document your formatting choices in a hidden Notes sheet or at the top of the workbook. If a colleague inherits the file in six months, a note saying thin gray equals internal divider, dark blue equals section boundary, double black equals grand total saves them hours of confusion. This is especially important for reports that get reused across quarters or years.

Finally, practice. Lines feel like a small skill but they are the foundation of everything visual in Excel. Build a sample workbook, try every method covered in this guide, and time yourself reformatting a messy spreadsheet into a clean one. After three or four practice sessions the muscle memory takes over and you will never again be the person whose reports look unfinished.

FREE Excel Questions and Answers
Full timed practice test covering formatting, formulas, functions, and analysis.
FREE Excel Trivia Questions and Answers
Fun trivia format testing shortcuts, history, and lesser-known Excel features.

Excel Questions and Answers

How do I add lines between rows in Excel?

Select the range that includes your rows, open the Home tab, click the Borders dropdown arrow, and choose All Borders. This adds a thin line between every row and column in your selection. For just horizontal lines between rows, use Format Cells with Ctrl+1, switch to the Border tab, and click only the top and bottom edges of the preview rather than the side edges, leaving the left and right borders blank.

Why are my gridlines not showing in Excel?

Gridlines hide automatically when a cell has a fill color applied, even if that color is white. To restore the gridline appearance, select the range, open the fill dropdown in the Home tab, and choose No Fill rather than white. If gridlines are missing across the entire sheet, go to the View tab and confirm the Gridlines checkbox is on. The setting is independent for each worksheet, so toggling it in one tab does not affect others.

How do I draw a diagonal line in a cell?

Select the cell, press Ctrl+1 to open Format Cells, and switch to the Border tab. Pick a line style first, then click one of the two diagonal buttons in the lower-right of the preview area to add a slash from corner to corner. To add labels on either side of the diagonal, type both terms separated by Alt+Enter and use cell alignment to push one to the top-left and the other to the bottom-right.

Can I make a line follow a formula condition?

Yes. Use Conditional Formatting on the Home tab, create a new rule with a formula like =A2<0, and in the format options open the Border tab to apply a colored bottom border. The border will appear automatically whenever the condition is true and disappear when false. This is great for highlighting variance rows or items that fall below a threshold without manually updating borders every time data changes.

How do I remove all borders quickly?

Select the range and press Ctrl+Shift+_ on Windows or Cmd+Option+Hyphen on Mac to instantly clear all borders. Alternatively, open the Borders dropdown on the Home tab and choose No Border. This removes manually applied borders but does not affect table styles or conditional formatting borders, which must be removed by editing the table style or deleting the conditional rule from Conditional Formatting Rules Manager.

What is the difference between a sparkline and a chart?

A sparkline is a miniature chart that lives entirely inside a single cell, drawn without axes or titles, while a regular chart is a separate object that floats above cells with full labeling. Sparklines are designed to show pattern at a glance next to the underlying data, while charts are designed for standalone presentation. Sparklines load faster, take no extra space, and update automatically with their source data, making them ideal for dashboards and summary tables.

How do I print gridlines in Excel?

Go to the Page Layout tab and check the Print box under Gridlines in the Sheet Options group. This setting is separate from the View tab Gridlines checkbox, which only controls screen display. You can also enable printing through File, Print, Page Setup, Sheet tab, and check Gridlines. Note that if you have applied a fill color or borders, those will override printed gridlines for those specific cells regardless of the print setting.

How do I make a thick border in Excel?

Open Format Cells with Ctrl+1, go to the Border tab, and choose a thicker line style from the Line section before clicking the edges you want to thicken. The thickest preset is the bottom-right option in the styles list. Alternatively, use the Borders dropdown on the Home tab and pick Thick Outside Borders or Thick Bottom Border for one-click thick lines. Always select your style before clicking edges, not after.

Can I draw freehand lines on a worksheet?

Yes. Go to Insert, Shapes, and choose the straight line, curve, or freeform tool. Click and drag on the worksheet to draw, then use the Shape Format tab to change color, weight, and arrowheads. Shapes float above cells and do not affect data, making them perfect for annotations and connectors. They will not move when you sort or filter, so keep them on dashboards rather than inside data tables.

Why do my borders look different in print preview?

Print preview renders borders at the printer's resolution and ignores screen zoom, so thin borders that look bold on a high-resolution monitor can appear faint or invisible in print. The fix is to bump important borders up to 1.5 points or thicker, choose darker colors, and always export a test PDF before sending. Different PDF readers and printers also render lines slightly differently, so test on the target device whenever possible.
โ–ถ Start Quiz