Tally outstanding receivables in Google Sheets, with ageing
Who owes you, how much, and for how long, from TallyPrime's own bill-wise details, in a Google Sheet your team can open anywhere. It keeps working when the Tally PC is switched off.
How it works
The EJI Tally Agent on the Tally PC reads the companies you connect and sends them to EJI API. It only reads; it never changes your books. The Google Sheets formulas then read that copy, so the sheet works from any computer or phone, and with the Tally PC off. The figures are as of the last sync; =EJI_TALLY_LAST_SYNC() tells you when that was.
The amounts come from Tally's bill-wise details for parties under Sundry Debtors. A party with bill-wise details turned off shows its balance as one "On Account" line, as Tally itself does.
1. Set up once (about five minutes)
- Get an accounting key and link the agent: see beta access.
- In your Google Sheet: Extensions → Apps Script, paste the EJI script, save, and reload the sheet. The full steps, with the script to copy, are on the Sheets Lab page.
- Use EJI API › Accounting › Set API key from the sheet's menu.
2. The total and each party
Each formula is typed in one cell; the ones that return a table fill the cells below and to the right. These are the real answers for our demo company, Demo Traders Pvt Ltd, on 27 November 2026:
=EJI_TALLY_RECEIVABLES() → 23,86,440.30
=EJI_TALLY_OUTSTANDING("New India Garage") → 5,37,332.91
=EJI_TALLY_RECEIVABLES_BY_PARTY() → a table, largest firstParty Receivable New India Garage 5,37,332.91 Pink City Auto 3,29,456.00 Sharma Inverters 3,01,891.20 Royal Electric Co 2,78,102.40 Kota Power Solutions 1,68,563.19
Give a date to see the position on that day, for example =EJI_TALLY_RECEIVABLES("2026-03-31") for the year end. Put party names in a column and pass the range, =EJI_TALLY_OUTSTANDING(A2:A20), to get one amount per row.
3. Every open bill, with days overdue
=EJI_TALLY_BILLS("receivable")Party Bill Bill date Due date Days overdue Amount Ajmer Auto World DT/26-27/1264 23-Oct-2026 22-Nov-2026 5 16,284.00 Ajmer Auto World DT/26-27/1265 23-Oct-2026 22-Nov-2026 5 38,963.60 Balaji Traders DT/26-27/1234 08-Oct-2026 07-Nov-2026 20 12,921.00
The demo company has 87 open receivable bills. Add a party as the second argument for one customer's bills: =EJI_TALLY_BILLS("receivable", "Pink City Auto"). Use "payable" for what you owe suppliers.
4. An ageing table
With the bills in columns A to F (days overdue in E, amount in F), ordinary SUMIFS formulas give the ageing. On the demo company:
Not due =SUMIFS(F:F, E:E, "<=0") → 2,43,988.60 1 to 30 days =SUMIFS(F:F, E:E, ">=1", E:E, "<=30") → 14,82,327.80 31 to 60 days =SUMIFS(F:F, E:E, ">=31", E:E, "<=60") → 3,02,091.99 61 to 90 days =SUMIFS(F:F, E:E, ">=61", E:E, "<=90") → 57,938.00 Over 90 days =SUMIFS(F:F, E:E, ">90") → 3,00,093.91
The five add up to the total from step 2. The due date is the bill date plus the credit period on the bill in Tally, or the party's default credit period; with neither, it is the bill date. An "On Account" line has no bill date and so no days overdue: it stays out of these five rows, so add it separately if you have one. The demo company has none.
The same from code
The formulas call the outstanding endpoint of the Tally API. In Python:
import os
import requests
BASE = os.environ.get("EJI_ACC_BASE", "https://acc.ejiapi.com")
HEADERS = {"x-api-key": os.environ.get("EJI_ACC_KEY", "YOUR_KEY")}
companies = requests.get(f"{BASE}/api/tally/v1/companies", headers=HEADERS, timeout=30).json()["data"]
company = companies[0]["id"]
data = requests.get(f"{BASE}/api/tally/v1/companies/{company}/outstanding", params={"side": "receivable"},
headers=HEADERS, timeout=30).json()["data"]
print("Receivable on", data["date"], ":", f"{data['total']:,.2f}", "in", len(data["bills"]), "open bills")
buckets = {"Not due": 0.0, "1-30 days": 0.0, "31-60 days": 0.0, "61-90 days": 0.0, "Over 90 days": 0.0}
for b in data["bills"]:
d = b["overdueDays"]
if d is None: # an "On Account" line: no bill date, so no age
continue
key = "Not due" if d <= 0 else "1-30 days" if d <= 30 else "31-60 days" if d <= 60 else "61-90 days" if d <= 90 else "Over 90 days"
buckets[key] += b["amount"]
for k, v in buckets.items():
print(f"{k:>13}: {v:>14,.2f}")
print("Largest:", ", ".join(f"{p['party']} {p['amount']:,.0f}" for p in data["parties"][:3]))Receivable on 2026-11-27 : 2,386,440.30 in 87 open bills
Not due: 243,988.60
1-30 days: 1,482,327.80
31-60 days: 302,091.99
61-90 days: 57,938.00
Over 90 days: 300,093.91
Largest: New India Garage 537,333, Pink City Auto 329,456, Sharma Inverters 301,891To try it without a key, point EJI_ACC_BASE at https://acc.ejiapi.com/demo: it reads only the demo company. Or open the explorer.
Payables, and MSME suppliers
=EJI_TALLY_PAYABLES() and =EJI_TALLY_BILLS("payable") give the same view for what you owe. If some suppliers are micro or small enterprises, a bill not paid within 15 days (or the agreed date, at most 45 days) is deducted for income tax only in the year it is paid: section 37(2)(g) of the Income-tax Act 2025, earlier section 43B(h). The MSME API checks those due dates; see the year-end check.
Get beta access All Tally formulas
The demo company is made up. Sample outputs were produced on 2026-11-27 from the live API and change as the demo data is refreshed.