Import Stock Item Masters with GST Tax Rates
Published
This exercise imports Unit and Stock Item masters together with their
HSN/SAC code and GST tax rates from Excel into Tally Prime. It builds on
the Stock Item Masters with Opening Stock exercise.
Every value is read from the sheet through COLUMNREFERENCE or
FORMULA, and SKIP leaves out the opening value, the GST details
and the Cess rates that are not needed for an item.
The Excel sheet
Each row is one stock item: Name (column B), Unit (C), Opening Value (D), GST applicable (E) and its applicable-from date (F), HSN/SAC code and description (G, H), Taxability (M), the flags in columns I, N and O, the tax percentages (columns P to W), and the type of supply (X). Diesel (row 21) is a non-GST good, so its GST details are left empty.
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | srno | name | units | Op. Value | Is-GST-Applicable | Applicable-from-date | HSN/SAC Code | HSN/SAC Description | Is-a-non-GST-Good | Calculation-type | Rate-greater-than | Rate-up-to | Taxability | Is-Reverse-Charge-Applicable | Is-Ineligible-for-Input-Credit | IGST % | CGST % | SGST % | UT % | CESS % | CESS ON QTY | STATE CESS % | STATE CESS ON QTY | Type-of-Supply | GST-Classification |
| 2 | 1 | Basmati Rice (Packed) | Kg | 0 | Applicable | 01-04-2026 | 1006 | Rice | No | On Value | Taxable | No | No | 5 | 2.5 | 2.5 | 2.5 | 0 | 0 | 0 | 0 | Goods | |||
| 3 | 2 | Wheat Flour (Atta) Packed | Kg | 0 | Applicable | 01-04-2026 | 1101 | Wheat or meslin flour | No | On Value | Taxable | No | No | 5 | 2.5 | 2.5 | 2.5 | 0 | 0 | 0 | 0 | Goods | |||
| 4 | 3 | Sugar | Kg | 0 | Applicable | 01-04-2026 | 1701 | Cane or beet sugar | No | On Value | Taxable | No | No | 5 | 2.5 | 2.5 | 2.5 | 0 | 0 | 0 | 0 | Goods | |||
| 5 | 4 | Sunflower Oil | Ltr | 0 | Applicable | 01-04-2026 | 1512 | Sunflower-seed oil | No | On Value | Taxable | No | No | 5 | 2.5 | 2.5 | 2.5 | 0 | 0 | 0 | 0 | Goods | |||
| 6 | 5 | Tea | Kg | 0 | Applicable | 01-04-2026 | 0902 | Tea | No | On Value | Taxable | No | No | 5 | 2.5 | 2.5 | 2.5 | 0 | 0 | 0 | 0 | Goods | |||
| 7 | 6 | Butter | Kg | 0 | Applicable | 01-04-2026 | 0405 | Butter and dairy spreads | No | On Value | Taxable | No | No | 5 | 2.5 | 2.5 | 2.5 | 0 | 0 | 0 | 0 | Goods | |||
| 8 | 7 | Fresh Milk | Ltr | 0 | Applicable | 01-04-2026 | 0401 | Milk and cream | No | On Value | Nil Rated | No | No | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | Goods | |||
| 9 | 8 | Packaged Drinking Water | Ltr | 0 | Applicable | 01-04-2026 | 2201 | Waters including mineral waters | No | On Value | Taxable | No | No | 18 | 9 | 9 | 9 | 0 | 0 | 0 | 0 | Goods | |||
| 10 | 9 | Aerated Soft Drink | Ltr | 0 | Applicable | 01-04-2026 | 2202 | Sweetened or flavoured waters | No | On Value | Taxable | No | No | 40 | 20 | 20 | 20 | 0 | 0 | 0 | 0 | Goods | |||
| 11 | 10 | Bath Soap | Nos | 0 | Applicable | 01-04-2026 | 3401 | Soap and organic surface-active products | No | On Value | Taxable | No | No | 5 | 2.5 | 2.5 | 2.5 | 0 | 0 | 0 | 0 | Goods | |||
| 12 | 11 | Toothpaste | Nos | 0 | Applicable | 01-04-2026 | 3306 | Oral or dental hygiene preparations | No | On Value | Taxable | No | No | 5 | 2.5 | 2.5 | 2.5 | 0 | 0 | 0 | 0 | Goods | |||
| 13 | 12 | Cement (OPC) | Bag | 0 | Applicable | 01-04-2026 | 2523 | Portland cement | No | On Value | Taxable | No | No | 18 | 9 | 9 | 9 | 0 | 0 | 0 | 0 | Goods | |||
| 14 | 13 | Mobile Phone | Nos | 0 | Applicable | 01-04-2026 | 8517 | Telephones for cellular networks | No | On Value | Taxable | No | No | 18 | 9 | 9 | 9 | 0 | 0 | 0 | 0 | Goods | |||
| 15 | 14 | Laptop | Nos | 0 | Applicable | 01-04-2026 | 8471 | Automatic data processing machines | No | On Value | Taxable | No | No | 18 | 9 | 9 | 9 | 0 | 0 | 0 | 0 | Goods | |||
| 16 | 15 | Television (LED) | Nos | 0 | Applicable | 01-04-2026 | 8528 | Monitors and projectors; television receivers | No | On Value | Taxable | No | No | 18 | 9 | 9 | 9 | 0 | 0 | 0 | 0 | Goods | |||
| 17 | 16 | Air Conditioner | Nos | 0 | Applicable | 01-04-2026 | 8415 | Air conditioning machines | No | On Value | Taxable | No | No | 18 | 9 | 9 | 9 | 0 | 0 | 0 | 0 | Goods | |||
| 18 | 17 | Notebook (Paper) | Nos | 0 | Applicable | 01-04-2026 | 4820 | Registers; account books; note books | No | On Value | Taxable | No | No | 12 | 6 | 6 | 6 | 0 | 0 | 0 | 0 | Goods | |||
| 19 | 18 | Medicines (Tablets) | Strip | 0 | Applicable | 01-04-2026 | 3004 | Medicaments in measured doses | No | On Value | Taxable | No | No | 5 | 2.5 | 2.5 | 2.5 | 0 | 0 | 0 | 0 | Goods | |||
| 20 | 19 | Tobacco Cigarettes | Pkt | 0 | Applicable | 01-04-2026 | 2402 | Cigars and cigarettes | No | On Value | Taxable | No | No | 40 | 20 | 20 | 20 | 0 | 0 | 0 | 0 | Goods | |||
| 21 | 20 | Diesel | Ltr | 0 | Not Applicable | 01-04-2026 | 2710 | Petroleum oils | Yes | No | No | Goods |
Step 1 — Create the Unit master
The Unit is created from column C. ORIGINALNAME is not used because the same
unit repeats on many rows. The GST Unit Quantity Code (UQC) is chosen from the unit name
with nested If functions, and any unit that is not listed (such as Strip)
falls back to OTH-OTHERS.
<!-- Unit Master from Column C (units must exist before stock items) -->
<MASTER TYPE="UNIT">
<NAME COLUMNREFERENCE="C"/>
<!-- REMARK [Duplicate Original Name]: ORIGINALNAME is not used. The same unit repeats on many CSV rows, and a repeated ORIGINALNAME is rejected as a duplicate, so the unit was never created and stock items failed with "unit does not exist". -->
<ISSIMPLEUNIT>Yes</ISSIMPLEUNIT>
<ISGSTEXCLUDED>No</ISGSTEXCLUDED>
<!-- REMARK [Unit Quantity Code]: UQC is mapped per unit name from column C (GST portal UQC list). Strip has no UQC of its own, so it maps to OTH-OTHERS; any unit not listed here also falls back to OTH-OTHERS. -->
<GSTREPUOM FORMULA="=If(C#="Kg","KGS-KILOGRAMS",If(C#="Ltr","LTR-LITRES",If(C#="Nos","NOS-NUMBERS",If(C#="Bag","BAG-BAGS",If(C#="Pkt","PAC-PACKS","OTH-OTHERS")))))"/>
</MASTER>
Step 2 — Create the Stock Item master with GST details
-
Basics — the name (column B) and unit (column C).
OPENINGVALUEusesSKIPwhen column D is 0 or blank, and the value is multiplied by -1 because stock value is negative in Tally. -
GST applicable —
GSTAPPLICABLEadds the~[~prefix to column E to get the Tally system value Applicable / Not Applicable.SKIPonGSTDETAILS.LISTleaves out all GST details when the item is not GST applicable. -
Applicable from — udiMagic reads column F as an Excel date serial, so
Text(F#,"yyyymmdd")converts it to the date format Tally expects. - Rates — Central Tax (column Q), State Tax (column R) and Integrated Tax (column P) are taken directly. The UT % column is not imported because Tally has no UT head.
-
Cess and State Cess — the valuation type is Based on Value when the
percentage is given, Based on Quantity when only the quantity rate is given,
and Not Applicable when both are 0.
SKIPremoves the rate in the last case. -
HSN details —
HSNDETAILS.LISTholds the HSN/SAC code (column G) and its description (column H) at the item level.
<!-- Stock Item Master from Column B; HSN and GST rates come from the same CSV row -->
<MASTER TYPE="STOCKITEM">
<NAME.LIST>
<NAME COLUMNREFERENCE="B"/>
</NAME.LIST>
<!-- REMARK: No PARENT tag, so items are created under Primary. -->
<BASEUNITS COLUMNREFERENCE="C"/>
<!-- REMARK: Opening value (column D) is skipped when blank or 0. Stock value is negative in Tally. -->
<OPENINGVALUE SKIP="=Round(D#,2)=0" FORMULA="=Round(D#,2)*-1"/>
<!-- REMARK: Applicable / Not Applicable from column E; ~[~ prefix = Tally system value. -->
<GSTAPPLICABLE FORMULA="="~[~ " & E#"/>
<GSTTYPEOFSUPPLY COLUMNREFERENCE="X"/>
<!-- REMARK: GST details are skipped for items where GST is Not Applicable (e.g. non-GST goods like Diesel). -->
<GSTDETAILS.LIST SKIP="=E#<>"Applicable"">
<!-- REMARK [Applicable From Date]: udiMagic reads column F as an Excel date serial (e.g. 46113), not as dd-mm-yyyy text. The earlier Right/Mid/Left formula built an invalid date (28262642) and Tally ignored the whole GST block, so no rates showed. Text() converts the date to yyyymmdd. If Text() is not accepted, use =Year(F#)*10000+Month(F#)*100+Day(F#). -->
<APPLICABLEFROM FORMULA="=Text(F#,"yyyymmdd")"/>
<!-- REMARK: On Value / On Item Rate (column J); blank defaults to On Value. -->
<CALCULATIONTYPE FORMULA="=If(Len(trim(J#))=0,"On Value",J#)"/>
<!-- REMARK [Tally Prime 3.0+]: "Specify Details Here" = GST rate details are set on the item itself. -->
<SRCOFGSTDETAILS>Specify Details Here</SRCOFGSTDETAILS>
<HSNCODE COLUMNREFERENCE="G"/>
<!-- REMARK: HSN/SAC description from column H. -->
<HSN COLUMNREFERENCE="H"/>
<!-- REMARK: Taxability from column M: Taxable / Exempt / Nil Rated / Non-GST. Must match Tally spelling. -->
<TAXABILITY COLUMNREFERENCE="M"/>
<!-- REMARK [Tally Prime 3.0+]: GST flags on the stock item (reverse charge, non-GST goods, ineligible ITC). -->
<ISREVERSECHARGEAPPLICABLE COLUMNREFERENCE="N"/>
<ISNONGSTGOODS COLUMNREFERENCE="I"/>
<GSTINELIGIBLEITC COLUMNREFERENCE="O"/>
<!-- REMARK: Rates apply to all states (~[~ Any). Duty head names must be Central Tax / State Tax / Integrated Tax, not CGST / SGST / IGST. -->
<STATEWISEDETAILS.LIST>
<STATENAME>~[~ Any</STATENAME>
<!-- Central Tax = CGST % (column Q) -->
<RATEDETAILS.LIST>
<GSTRATEDUTYHEAD>Central Tax</GSTRATEDUTYHEAD>
<GSTRATEVALUATIONTYPE>Based on Value</GSTRATEVALUATIONTYPE>
<GSTRATE FORMULA="=Round(Q#,2)"/>
</RATEDETAILS.LIST>
<!-- State Tax = SGST % (column R) -->
<RATEDETAILS.LIST>
<GSTRATEDUTYHEAD>State Tax</GSTRATEDUTYHEAD>
<GSTRATEVALUATIONTYPE>Based on Value</GSTRATEVALUATIONTYPE>
<GSTRATE FORMULA="=Round(R#,2)"/>
</RATEDETAILS.LIST>
<!-- Integrated Tax = IGST % (column P) -->
<RATEDETAILS.LIST>
<GSTRATEDUTYHEAD>Integrated Tax</GSTRATEDUTYHEAD>
<GSTRATEVALUATIONTYPE>Based on Value</GSTRATEVALUATIONTYPE>
<GSTRATE FORMULA="=Round(P#,2)"/>
</RATEDETAILS.LIST>
<!-- REMARK [Cess Valuation Type]: Cess uses "Not Applicable" (~[~ prefix = Tally system value) when columns T and U are both 0/blank. "Based on Value" with no rate caused the invalid/not specified error. GSTRATE is skipped in that case. -->
<RATEDETAILS.LIST>
<GSTRATEDUTYHEAD>Cess</GSTRATEDUTYHEAD>
<GSTRATEVALUATIONTYPE FORMULA="=If(Round(T#,2)>0,"Based on Value",If(Round(U#,2)>0,"Based on Quantity","~[~ Not Applicable"))"/>
<GSTRATE SKIP="=Round(T#,2)+Round(U#,2)=0" FORMULA="=If(Round(T#,2)>0,Round(T#,2),Round(U#,2))"/>
</RATEDETAILS.LIST>
<!-- REMARK [Cess Valuation Type]: State Cess follows the same rule using columns V and W. -->
<RATEDETAILS.LIST>
<GSTRATEDUTYHEAD>State Cess</GSTRATEDUTYHEAD>
<GSTRATEVALUATIONTYPE FORMULA="=If(Round(V#,2)>0,"Based on Value",If(Round(W#,2)>0,"Based on Quantity","~[~ Not Applicable"))"/>
<GSTRATE SKIP="=Round(V#,2)+Round(W#,2)=0" FORMULA="=If(Round(V#,2)>0,Round(V#,2),Round(W#,2))"/>
</RATEDETAILS.LIST>
</STATEWISEDETAILS.LIST>
</GSTDETAILS.LIST>
<!-- REMARK [Tally Prime 3.0+]: HSN/SAC at item level, kept after GSTDETAILS.LIST. The applicable-from date is fixed at 01-04-2023 and the HSN code comes from column G. The HSN description comes from column H. -->
<HSNDETAILS.LIST>
<APPLICABLEFROM>20230401</APPLICABLEFROM>
<HSNCODE COLUMNREFERENCE="G"/>
<HSN COLUMNREFERENCE="H"/>
<SRCOFHSNDETAILS>Specify Details Here</SRCOFHSNDETAILS>
</HSNDETAILS.LIST>
</MASTER>
- The Unit master must be created before the Stock Item master, so it comes first in the XML tags.
- No
PARENTtag is used, so the items are created under Primary. - Columns A, K, L and Y (serial number, slab limits and GST classification) are not imported.
- The rate head names must be Central Tax, State Tax and Integrated Tax, not CGST, SGST and IGST. Taxability must match Tally's spelling: Taxable, Exempt, Nil Rated or Non-GST.
- Tags marked Tally Prime 3.0+ in the comments are needed only for Tally Prime 3.0 and later.
Ready to import your Excel data into Tally?
Download udiMagic and start a 14-day free trial — no credit card required.
Download udiMagic View Pricing