Exercise 23

Import Ledgers with GST Tax Rates

Published


This exercise teaches you how to import Ledger masters with their GST details and tax rates from Excel into Tally Prime. It creates a Sales ledger and a Purchase ledger with HSN code, GST applicability and rate, together with the CGST, SGST and IGST duty ledgers.

Step 1 — Prepare the Excel sheet

Create an Excel sheet with one row per ledger. Column A (Sr No) is the key field of the exercise. Leave the GST cells blank for the duty ledgers (CGST, SGST, IGST), because they have a duty type, tax type and rate instead of HSN and nature of transaction.

A B C D E F G H I J K L M N O
1 Sr No Ledger Name Alias Ledger Group GST Rate HSN Code Is Applicable ApplicableFromDate Nature of Transaction Taxability Type of Duty Tax Type Tax Rate Narration Type of Supply
2 1 Inter-State Sales @ 18% [GST Test] Sales Accounts 18 84713010 Applicable 01/07/2025 Interstate Sales - Taxable Taxable Goods
3 2 Local Purchase @ 12% [GST Test] Purchase Accounts 12 84713010 Applicable 02/07/2025 Local Purchase-Taxable Taxable Goods
4 3 CGST @ 9% [GST Test] Duties & Taxes GST Central Tax 9
5 4 SGST @ 9% [GST Test] Duties & Taxes GST State Tax 9
6 5 IGST @ 18% [GST Test] Duties & Taxes GST Integrated Tax 18

Step 2 — Write the XML tags in a separate file

Open Notepad (or any plain-text editor) and write the following XML tags:

<!--
  Columns referenced by this XML:
  A = Sr No (key field)                   B = Ledger Name
  C = Alias                               D = Ledger Group
  E = Integrated Tax Rate                 F = HSN Code
  G = Is Applicable                       H = ApplicableFromDate
  I = Nature of Transaction               J = Taxability
  K = Type of Duty                        L = Tax Type
  M = Tax Rate                            N = Narration
  O = Type of Supply
-->
<!-- CELLREFERENCE="A1" makes Sr No the key: rows sharing it are treated as one ledger. -->
<XMLTAGS CELLREFERENCE="A1" xmlns:UDF="TallyUDF">
    <MASTER TYPE="LEDGER">
        <NAME.LIST>
            <!-- Ledger name -->
            <NAME COLUMNREFERENCE="B"/>
            <!-- Ledger alias -->
            <NAME COLUMNREFERENCE="C"/>
        </NAME.LIST>
        <!-- Group under which the ledger is created (Sales Accounts / Purchase Accounts) -->
        <PARENT COLUMNREFERENCE="D"/>
        <!-- Ledger narration -->
        <NARRATION COLUMNREFERENCE="N"/>
        <!-- Fixed flags: sales/purchase ledgers do not use bill-wise tracking, cost centres, stock or VAT -->
        <ISBILLWISEON>No</ISBILLWISEON>
        <ISCOSTCENTRESON>No</ISCOSTCENTRESON>
        <AFFECTSSTOCK>No</AFFECTSSTOCK>
        <USEFORVAT>No</USEFORVAT>
        <!-- GST applicability: Column G (Is Applicable) -->
        <GSTAPPLICABLE FORMULA="=If(Lower(Trim(G#))=&quot;applicable&quot;,&quot;~[~ Applicable&quot;,&quot;~[~ Not Applicable&quot;)"/>
        <!-- Type of supply (Goods / Services): Column O -->
        <GSTTYPEOFSUPPLY COLUMNREFERENCE="O"/>

        <!-- GST details block: skipped when H, F, I, J and E are all blank, so ledgers without GST data get no empty block -->
        <GSTDETAILS.LIST SKIP="=And(len(trim(H#))=0,len(trim(F#))=0,len(trim(I#))=0,len(trim(J#))=0,len(trim(E#))=0)">
            <!-- Date from which these GST details apply -->
            <APPLICABLEFROM COLUMNREFERENCE="H"/>
            <TAXABILITY>Taxable</TAXABILITY>
            <SRCOFGSTDETAILS>Specify Details Here</SRCOFGSTDETAILS>
            <!-- Nature of transaction, e.g. Sales Taxable / Purchase Taxable: Column I -->
            <GSTNATUREOFTRANSACTION COLUMNREFERENCE="I"/>
            <ISREVERSECHARGEAPPLICABLE>No</ISREVERSECHARGEAPPLICABLE>
            <ISNONGSTGOODS>No</ISNONGSTGOODS>
            <STATEWISEDETAILS.LIST>
                <!-- Rates apply to any state -->
                <STATENAME FORMULA="=&quot;~[~ Any&quot;"/>

                <!-- Enter the GST rate in E, e.g. 18. The CGST and SGST rates are half of this value -->
                <RATEDETAILS.LIST>
                    <GSTRATEDUTYHEAD>Central Tax</GSTRATEDUTYHEAD>
                    <GSTRATEVALUATIONTYPE>Based on Value</GSTRATEVALUATIONTYPE>
                    <GSTRATE FORMULA="=Round(E#/2,2)"/>
                </RATEDETAILS.LIST>
                <RATEDETAILS.LIST>
                    <GSTRATEDUTYHEAD>State Tax</GSTRATEDUTYHEAD>
                    <GSTRATEVALUATIONTYPE>Based on Value</GSTRATEVALUATIONTYPE>
                    <GSTRATE FORMULA="=Round(E#/2,2)"/>
                </RATEDETAILS.LIST>
                <RATEDETAILS.LIST>
                    <GSTRATEDUTYHEAD>Integrated Tax</GSTRATEDUTYHEAD>
                    <GSTRATEVALUATIONTYPE>Based on Value</GSTRATEVALUATIONTYPE>
                    <GSTRATE COLUMNREFERENCE="E"/>
                </RATEDETAILS.LIST>
            </STATEWISEDETAILS.LIST>
        </GSTDETAILS.LIST>

        <!-- HSN/SAC details for the ledger -->
        <HSNDETAILS.LIST>
            <APPLICABLEFROM COLUMNREFERENCE="H"/>
            <!-- HSN/SAC code: Column F -->
            <HSNCODE COLUMNREFERENCE="F"/>
            <SRCOFHSNDETAILS>Specify Details Here</SRCOFHSNDETAILS>
            <!-- Duty head and rate calculation method (Columns L, M) -->
            <GSTDUTYHEAD COLUMNREFERENCE="L"/>
            <RATEOFTAXCALCULATION COLUMNREFERENCE="M"/>
            <TAXTYPE>GST</TAXTYPE>
        </HSNDETAILS.LIST>
    </MASTER>
</XMLTAGS>

Step 3 — Save the file

Save it as ledger-with-gst-tax-rates-xml-tags.xml. In the Save as type box, choose All Files — otherwise Notepad appends .txt and you'll end up with ledger-with-gst-tax-rates-xml-tags.xml.txt instead.

Step 4 — Import into Tally

  1. Start Tally Prime and open the company you want to import into.
  2. Minimize Tally (leave it running).
  3. Start udiMagic and select Excel to Tally.
  4. Select option Import data into Tally.
  5. Browse to select both the Excel sheet and the XML tags file — you're prompted for the XML file on the same screen as the Excel sheet.
  6. Follow the wizard to complete the import.
Remarks:
  1. CELLREFERENCE="A1" makes Sr No (Column A) the key field, so each row is imported as one ledger.
  2. GSTAPPLICABLE is set by a FORMULA: it is Applicable when Column G says "Applicable", otherwise Not Applicable.
  3. GSTDETAILS.LIST is skipped by SKIP when the date, HSN, nature of transaction, duty and rate columns are all blank, so the duty ledgers get no empty GST block.
  4. The rate in Column E is set on each RATEDETAILS.LIST (Central Tax, State Tax and Integrated Tax). Tally uses the Central and State rates for intra-state and the Integrated rate for inter-state transactions.
  5. HSNDETAILS.LIST carries the HSN code (Column F), the duty head (Column L) and the rate of tax calculation (Column M).
Sample files: Download the sample Excel sheet and matching XML tags file for this exercise. Download ledger-with-gst-tax-rates.zip

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