Indian fund and market data in your Google Sheet
Pick what you want to do. You get one script; paste it once into your sheet.
-
Try formulas on live data
-
Add your purchases
Import from CSV or paste from a sheet
One purchase per line:
schemeCode,date,units,amount(amount optional, comma, tab or semicolon). Dates as 2026-04-15 or 15-04-2026. Negative units are a sale.Big portfolio? Use My key; the demo is rate limited. Not investment advice.
-
Ask CAMS or KFintech for your statement
-
Bring it into your sheet
Needs your own key (My key above). The PDF is read in memory, not stored. Values, not advice.
-
Add any API data optional
Pick fields from any answer; get a ready table of formulas.Want more about your funds, such as returns or exit load? Your scheme codes are filled in.Want more about the funds in your statement? Their scheme codes are filled in once it is read.
API path
In your sheet: paste into cell A1 of a new tab, after the script is in. Every script on this page includes these formulas.
-
Pick the tabs, copy the script
Paste it in Extensions → Apps Script, Save, reload, then EJI API → Build my CAS workbook. It has the formulas too.
-
Copy your script
One script: every formulayour portfolio, every formula and an EJI API menu.
Already have a sheet? Copy cells
-
Paste it into your sheet
Extensions → Apps ScriptReplace the code, SaveReload the sheetGoogle then asks you to allow the script. Because it is your own copy, it shows Google hasn’t verified this app: click Advanced → Go to … (unsafe) → Allow. The script reads only this sheet and talks only to ejiapi.com.
-
Set your key, then builduse it
Then EJI API → Finance → Build my portfolio sheet. Type
=EJI_in any cell and Google lists every formula with its help, or use EJI API → Insert formula… for examples and a field picker.Something not working?
"Google hasn't verified this app": it is your own script. Click Advanced → Go to … (unsafe) → Allow.
#ERROR! in a cell: hover to read why, then EJI API → Finance → Check setup and Refresh values. Ranges such as
=EJI_MF_NAV(A2:A20)and=EJI_…need a script copied on or after 21 Nov 2026.
One sheet, one script. To change it, paste the new script over the old one.
All formulas
Your grid, portfolio and statement stay in this browser; the API only sees codes, symbols and dates.
Demo mode needs no key, but it is shared and rate limited, so use your own key for real work and in your sheet. Get a key · Pricing · Accounting has its own formulas at acc.ejiapi.com/sheets.
Worked examples
Code we ran, with its real output.
Mutual fund NAV in Google Sheets
A FUNDNAV function with Apps Script.
Read the guidePortfolio tracker from your CAS
Every fund you hold, with value, gain and XIRR, from a CAS PDF.
Read the guideIPO subscription and GMP in Google Sheets
A live tracker: price, lot, subscription by category, GMP.
Read the guide