Python Forum
Reading from Excel: value not formula!
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reading from Excel: value not formula!
#1
Hi everybody

I am trying to read some data from an excel file in python. Here is a part of my code:
def main():


xl_element = utils.XlsxOpen(r'C:\..........sheet1.xlsx' )
value_1=utils.XlsxGetCellValue(xl_element, "Sheet1", 0 ,0)

print (value_1)

if __name__ == '__main__':
main()
The problem is that when it reads from excel, for the cells I have a formula it shows the formula , not the value calculated.
for example I have a cell with "COUNTA(F5:H5)" formula and value "2",... I need to save value in a variable in python not the formula.

Does anybody can help me?

Thank you.
Larz60+ write Oct-29-2020, 02:57 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.

Added for you this time. please use on future posts.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  trouble reading string/module from excel as a list popular_dog 0 384 Oct-04-2023, 01:07 PM
Last Post: popular_dog
  Help using a dynamic array excel formula with XLWings FXMonkey 2 1,208 Jun-06-2023, 09:46 PM
Last Post: FXMonkey
  Reading data from excel file –> process it >>then write to another excel output file Jennifer_Jone 0 1,046 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone
  Excel file reading problem max70990 1 865 Dec-11-2022, 07:00 PM
Last Post: deanhystad
  Openpyxl manipulate excel write formula SamLiu 0 1,002 Nov-04-2022, 03:00 PM
Last Post: SamLiu
  Reading Excel file and use a wildcard in file name and sheet name randolphoralph 6 6,857 Jan-13-2022, 10:20 PM
Last Post: randolphoralph
  {SOLVED]Help getting formula value in Excel to a csv Pedroski55 1 1,971 Sep-20-2021, 12:19 AM
Last Post: Pedroski55
  Python “Formula” Package: How do I parse Excel formula with a range of cells? JaneTan 1 2,640 Jul-12-2021, 11:09 AM
Last Post: jefsummers
  How do I read in a Formula in Excel and convert it to do the computation in Python? JaneTan 2 2,562 Jul-07-2021, 02:06 PM
Last Post: Marbelous
  Strange Problem when reading from excel faryad13 3 2,333 Nov-04-2020, 03:48 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020