Sheets Lab · Medical

Medicine prices and health data in your Google Sheet

MRP, price per unit, cheaper substitutes, ceiling prices, banned FDCs, CGHS rates and more, as formulas. Every formula starts with EJI_MED_; put your list of medicines in a column and fill the rest.

  1. Get your key

    Get a free beta key at med.ejiapi.com/get-key. It arrives by email and starts with med_.

  2. Copy your script

    Using more than one area in the same sheet? Tick it: one script carries every area you tick, with one EJI API menu.

  3. Paste it into your sheet

    Extensions → Apps Script
    Replace the code, Save
    Reload the sheet

    Google 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.

  4. Set your key, then type =EJI_

      Type =EJI_ in any cell and Google lists every formula with its help. Or use EJI API → Insert formula…: every formula with an example, and Pick fields to build a table from a medicine's details.

      Something not working?
      “Set your key first”
      use EJI API › Medical › Set API key.
      “The API key was not accepted”
      copy the whole key again; it starts with med_. Finance and accounting keys do not work here.
      “No medicine matches …”
      try a shorter text, such as the brand and strength ("dolo 650"), or look it up with =EJI_MED_SEARCH.
      The wrong pack was picked
      use the full pack name or the pack id from =EJI_MED_SEARCH.
      Permission errors
      run EJI API › Medical › Check setup once from the menu so Google can ask for permission.

    One sheet, one script. To change it, paste the new script over the old one. Sheets made with the old names (MED_…) keep working.

    How the formulas behave
    MedicineA pack name ("DOLO 650 MG TABLET 15"), a shorter text ("dolo 650": the first match is used, an exact pack name wins) or a pack id from EJI_MED_SEARCH. Check which pack was picked with EJI_MED_INFO(…, "name") when a short text could match several.
    ColumnsEJI_MED_PRICE, EJI_MED_PRICE_PER_UNIT, EJI_MED_INFO and EJI_MED_CHEAPEST take a range of up to 50 medicines and fill one cell per row.
    PricesRupees, as filed with NPPA for the month =EJI_MED_AS_OF() shows. The pack in hand can differ.
    Price checkAbout 1 pack in 100 has a price in NPPA's list that looks wrong: missing, or more than ten times below or above what the same composition usually costs. Tables mark these in the Price check column, and EJI_MED_SUBSTITUTES and EJI_MED_CHEAPEST leave them out.
    Fresh valuesAnswers are kept for 6 hours. EJI API › Medical › Refresh values fetches fresh ones.

    All formulas

    Same composition, not always the same medicine

    Release type and inactive ingredients can differ. Use these lists to ask your doctor or pharmacist, not to switch on your own.

    What CGHS rates are

    What CGHS pays empanelled hospitals for its beneficiaries: a public benchmark, not what a private patient will be charged.

    Prices: NPPA (Pharma Sahi Daam), Government of India, reproduced with credit. Reference information only, not medical advice: ask a doctor or pharmacist before changing a medicine.