Row 13 is the first item row. Rows 14 to 24 carry the same formulas with the row number changed. Each formula starts by checking for an empty row, which is why unused rows stay blank instead of showing zeros or errors.
| Cell | What it works out | Formula |
|---|
| A13 | Serial number, shown only when the row has a description | =IF(B13="","",ROW()-12) |
| C13 | HSN or SAC code, looked up from the Items sheet | =IF($B13="","",IFERROR(VLOOKUP($B13,Items!$A$2:$E$51,2,FALSE),"")) |
| E13 | Unit, looked up from the Items sheet | =IF($B13="","",IFERROR(VLOOKUP($B13,Items!$A$2:$E$51,3,FALSE),"")) |
| F13 | Rate, looked up from the Items sheet | =IF($B13="","",IFERROR(VLOOKUP($B13,Items!$A$2:$E$51,4,FALSE),"")) |
| H13 | Taxable value: quantity x rate, less the discount % | =IF(OR(D13="",F13=""),"",ROUND(D13*F13*(1-IF(G13="",0,G13)/100),2)) |
| I13 | GST %, looked up from the Items sheet | =IF($B13="","",IFERROR(VLOOKUP($B13,Items!$A$2:$E$51,5,FALSE),"")) |
| J13 | GST amount for the line | =IF(H13="","",ROUND(H13*IF(I13="",0,I13)/100,2)) |
| K13 | Line total: taxable value plus GST | =IF(H13="","",H13+IF(J13="",0,J13)) |
Three choices in those formulas are worth understanding before you change anything.
The discount sits inside the taxable value
H13 multiplies quantity by rate and then by one minus the discount percentage. GST in J13 is then worked out on that reduced figure. This is the treatment that carries through to the tax invoice, where a discount shown on the document reduces the taxable value.
ROUND is used on every money cell
Without ROUND, Excel keeps fractions of a paisa that you cannot see, and the column total can differ from the visible figures by a paisa. Rounding each line to two decimals makes the printed numbers add up exactly.
IFERROR keeps typed descriptions working
If you type a description that is not on the Items sheet, VLOOKUP finds nothing and IFERROR returns a blank instead of an error. Type the rate and GST % over the formulas in that row and the rest of the line still calculates.