On Mon, Jun 9, 2014 at 7:39 AM, Max Belkin
<
bernardito.l...@gmail.com> wrote:
> I guess every formulae always starts with symbol '=' and has some more
> symbols after. I don't know is that right or not but the simpliest way is to
> read a cell value then check its first symbol and length.
No, it's not right. Have you even used xlrd at all? Have you read
any xlrd documentation at all?
There's no officially documented way to know if a cell contains a
formula when read by xlrd. I haven't looked at the source code
closely enough to know if there is an undocumented way (there have
been posts suggesting various stages of partial solution), but I doubt
it. When you read a cell with xlrd, it gives you the last saved
evaluated value of that cell.
If your workbook is .xlsx (not .xls), you can try using openpyxl
instead. It seems to be able to read cell formulas. When you open a
workbook, you can choose whether the "value" of a cell is its last
saved evaluated value or its formula text, but for whatever reason,
you can't have both. (Note that some cells may have "shared"
formulas; in this case, you can easily tell that the cell contains a
formula, but it is tricky to get the formula text.)
John Y.