Confident CellsExcel practice Start free

Sales and purchase invoices: practice exercises

VAT from a rate code table, credit notes as minus lines, VAT for the quarter by code, supplier payment terms, VAT to pay. 5 exercises on real-looking data, each marked the moment you press Check. The first exercise is below to try now; the full lesson is part of Pro.

Your turn

The VAT rate for each code is in the table in G1:I5. In D2, work out the VAT on each line: the net times the rate for its code, rounded to the nearest penny.

ABCDEFGHI
1ItemVAT codeNetVATCodeRateMeaning
2Child car seatR£230.11S20%Standard
3Office chairsS£370.77R5%Reduced
4DeliveryS£79.79Z0%Zero-rated
5Child car seatR£84.11E0%Exempt
6Printer tonerS£94.73UK rates, checked Nov 2026 (gov.uk)
7Postage stampsE£56.57
8Printer tonerS£151.43
9DeliveryS£62.35
10Cleaning serviceS£585.01
11BooksZ£113.64
12DeliveryS£31.65
13Child car seatR£175.24

How it works

Invoices in a real ledger don't all carry 20% VAT. Each line has a VAT code: S for the standard rate of 20%, R for the reduced rate of 5% (home energy, children's car seats), Z for zero-rated goods at 0% (most food, children's clothes) and E for exempt (postage stamps, insurance). Look the rate up from a table of codes, so a rate change means changing one cell.

Work out the VAT on each line and round it to the penny, then add the lines up. A credit note cancels all or part of an invoice, so it goes in as a minus line and takes its VAT off the total. This lesson goes further than Invoices and VAT in Unit 4, which uses one rate.

=ROUND(C2*XLOOKUP(B2,$F$2:$F$5,$G$2:$G$5),2) =IF(A2="Credit note",-C2,C2) =SUMIFS(D$2:D$40,$B$2:$B$40,$F2) =B2+XLOOKUP(A2,$F$2:$F$9,$G$2:$G$9) =SUMIFS(E2:E30,B2:B30,"Sale")-SUMIFS(E2:E30,B2:B30,"Purchase")

VAT codes

Each line on an invoice has a VAT code, and the code sets the rate. The UK rates (checked on gov.uk in November 2026) are:

  • S, standard rate, 20%: most goods and services.
  • R, reduced rate, 5%: some things, such as home energy and children's car seats.
  • Z, zero-rated, 0%: most food, books and children's clothes.
  • E, exempt: no VAT at all, such as postage stamps, insurance and other financial services.

Zero-rated and exempt both put no VAT on the invoice, but they're treated differently, so keep them as separate codes. Put the codes and rates in a table, and look each line's rate up: XLOOKUP(B2,codes,rates). Rates do change, and then you change one cell.

Worked example

ABCDEFG
1ItemCodeNetVATCodeRate
2LaptopS£449.99S20%
3BooksZ£36.50R5%
4Child car seatR£89.99Z0%
5InsuranceE£120.00E0%
6Credit note: laptopS-£449.99
7Total
  1. =ROUND(C2*XLOOKUP(B2,$F$2:$F$5,$G$2:$G$5),2) in D2. The laptop is code S, so 449.99 × 20% = 89.998, rounded to £90.00. The car seat is code R: 89.99 × 5% = 4.4995, so £4.50. Books and insurance have no VAT, and the credit note takes the laptop's £90.00 back off.
  2. =SUM(D2:D6) in D7. Round each line first, then add the lines up: £4.50 of VAT on this invoice. HMRC lets you work VAT out line by line and round each line to the nearer penny.

Credit notes and the VAT quarter

A credit note cancels all or part of an invoice: goods sent back, or a mistake on the price. In the sales list it goes in as a minus line, with minus VAT, so totals take it off by themselves. If a list shows every amount as a plus number, turn the credit notes round: =IF(B2="Credit note",-D2,D2).

Most businesses send a VAT Return every 3 months, their VAT quarter, due one month and 7 days after it ends. SUMIFS totals the net and the VAT for each code. With the codes down column G and the net and VAT in columns D and E, =SUMIFS(D$2:D$30,$C$2:$C$30,$G2) copies across and down: D$2 moves to E$2, and $G2 moves down the codes.

A list that's still being filled needs totals that are ready for it. Make the ranges run to the bottom of the space you've left (row 30 here), not the last row filled in so far. Otherwise next week's invoices are missed and nobody notices.

Purchase invoices and the VAT to pay

Purchase invoices are what you owe your creditors (payables). Each supplier has payment terms in days, such as 30 or 60. Adding a number to a date moves it on that many days, so the due date is =B2+XLOOKUP(A2,suppliers,terms). Where no terms were agreed, a business payment is late 30 days after the invoice arrives.

The VAT to pay HMRC for the quarter is the VAT on sales (box 1 of the return) take away the VAT on purchases you can reclaim (box 4): =SUMIFS(vat,type,"Sale")-SUMIFS(vat,type,"Purchase"). A minus answer means HMRC owes you.

What you'll practise

  1. The VAT rate for each code is in the table in G1:I5. In D2, work out the VAT on each line: the net times the rate for its code, rounded to the nearest penny.
  2. The sales day book lists every amount as a plus number. In E2, show the amount to post: the net as it is for an invoice, and as a minus number for a credit note.
  3. This is the quarter's sales list so far, with credit notes as minus lines. It has room down to row 30 for the rest of the quarter. In H2, total the net for the VAT code in G2, covering rows 2 to 30 so it's ready for the invoices still to come. Your formula will be copied across to I (the VAT) and down to row 5.
  4. These are purchase invoices from suppliers (what we owe our creditors). Each supplier's payment terms, in days, are in G1:H7. In D2, work out when each invoice is due: the invoice date plus that supplier's terms.
  5. This quarter's sales and purchases are in one list, with a sales credit note as a minus line. In H1, work out the VAT to pay HMRC: the VAT on sales take away the VAT on purchases.

Guides with worked examples: Aged debtors in Excel: days overdue, ageing bands and totals · Bank reconciliation in Excel: matching the cash book to the statement