Excel formula values

26 views
Skip to first unread message

Phako Perez

unread,
Aug 24, 2018, 9:13:32 PM8/24/18
to django...@googlegroups.com
Hi everyone,

I’m trying to get data from an excel file.
Every thing goes fine till cell contains an excel formula, such cases is getting null values


Here I open the book
———————-
report_book = openpyxl.load_workbook(filename, data_only=True)
sheet_list = report_book.sheetnames
worksheet = report_book[sheet_list[0]]

Here I get value for each column
———————-
row_num = 3
for k in COL_H[row_num]['CL']:
bb = BASE + k
value = worksheet.cell(row=row_num, column=bb).value


Thanks in advance
Happy weekend!!!

Jason

unread,
Aug 24, 2018, 9:39:06 PM8/24/18
to Django users
this is a openpyxl issue, not a django issue.  so you're really posting in the wrong place.

second, googling 'openpyxl excel formula evaluate' returns a number of responses that could be helpful.

Phako Perez

unread,
Aug 24, 2018, 10:17:13 PM8/24/18
to django...@googlegroups.com
Actually what I need is to print the values from an excel on a table, but everything looks good, table formatted in html using CSS style for coloring 

However when a cel in excel is a formula, the value is not showing, as well when cel value is 0

Sent from my iPhone

On Aug 24, 2018, at 8:39 PM, Jason <jjohn...@gmail.com> wrote:

this is a openpyxl issue, not a django issue.  so you're really posting in the wrong place.

second, googling 'openpyxl excel formula evaluate' returns a number of responses that could be helpful.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2db0311d-3232-4784-8b18-3974dff41378%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jason

unread,
Aug 25, 2018, 8:20:03 AM8/25/18
to Django users
again, this is an openpyxl/excel issue, not a django issue.  you're asking in the wrong place, since this doesn't have anything to do with django at all.

Ravi Shankar

unread,
Aug 25, 2018, 10:21:55 AM8/25/18
to django...@googlegroups.com
Hi Phako Perez,

Use the below statement will solve your problem.

Sheet5.Range("B1").Value or Sheet5.Range("B" & i).Value, i as an variable.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
Reply all
Reply to author
Forward
0 new messages