Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7439535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:43:12+00:00 2026-05-29T10:43:12+00:00

I am running into a parse error while using xlwt. Simple formula’s like SUM()

  • 0

I am running into a parse error while using xlwt. Simple formula’s like SUM() work fine but I tried to run this slight more complex formula and received the following error.

xlwt.ExcelFormulaParser.FormulaParseException: can't parse formula =COUNTIFS(hospital_data!C1:C6500,LEFT(B1,4),hospital_data!D1:D65000,RIGHT(B1,1),hospital_data!F1:F65000,A3)

This is the code I am attempting to run.

hospital_count_formula = '=COUNTIFS(hospital_data!C1:C6500,LEFT({0},4),hospital_data!D1:D65000,RIGHT({0},1),hospital_data!F1:F65000,{1})'.format(quarter_ref, state_ref)

sheet_overview.write(row, column, Formula(hospital_count_formula))

I have tried using a defined numerical range (A1:A5000) instead of (A:A) and I have also tried simply passing this through as a string but it is not evaluated in Excel.

This formula does work when copy and pasted into Excel. Any thoughts would be most appreciated.

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:43:13+00:00Added an answer on May 29, 2026 at 10:43 am

    Have you read the answer that you got when you asked the same question on the python-excel google-group?

    (1) Lose the = … compare with your SUM() results.

    (2) The XLS format doesn’t support the COUNTIFS function, which was introduced in Excel 2007.

    This formula does work when copy and pasted into Excel.

    No, the formula preceded by a = so the Excel knows you mean formula instead of text does work, with Excel 2007 or later and you didn’t try to Save As Excel 97-2003 Workbook (*.xls), which doesn’t work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running into a rather strange GLSL compilation error while using Intel HD Graphics
I am attempting to parse a XML file using Javascript and I'm running into
Running into a problem where on certain servers we get an error that the
I'm trying to get into Java web development but seem to be running into
I'm running into some trouble validating uploaded images using the new IValidatabeObject interface in
I am running into an error in utils.rb:333 when I process a job with
How to parse a a JSON string in iOS app? Using SBJSON. Running the
Running into a problem. I have a table defined to hold the values of
Been running into this problem lately... When debugging an app in VS.Net 2005, breakpoints
I'm running into an issue where I have a FileUpload control in an UpdatePanel.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.