Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Formula Parse Error
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Kevin Lamb  
View profile  
 More options Feb 10, 5:20 pm
From: Kevin Lamb <kevincl...@gmail.com>
Date: Fri, 10 Feb 2012 14:20:01 -0800 (PST)
Local: Fri, Feb 10 2012 5:20 pm
Subject: Formula Parse Error
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!

Kevin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Machin  
View profile  
 More options Feb 10, 6:07 pm
From: John Machin <sjmac...@lexicon.net>
Date: Fri, 10 Feb 2012 15:07:04 -0800 (PST)
Local: Fri, Feb 10 2012 6:07 pm
Subject: Re: Formula Parse Error

Things to do to get yourself back on the road faster than by asking
questions here:

(1) compare the start of your working SUM formulas with the start of your
problematical COUNTIFS non-formula

(2) have a quick look in this group to see if the problem has been
mentioned already (e.g. topic "conditional formulas" last month appears
relevant)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Craig Barnes  
View profile  
 More options Feb 10, 6:38 pm
From: Craig Barnes <cjbarne...@gmail.com>
Date: Fri, 10 Feb 2012 23:38:42 +0000
Local: Fri, Feb 10 2012 6:38 pm
Subject: Re: [pyxl] Re: Formula Parse Error
no = needed :)

On 10 February 2012 23:07, John Machin <sjmac...@lexicon.net> wrote:

--
Craig

()  ascii ribbon campaign - against html mail
/\


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Machin  
View profile  
 More options Feb 10, 6:49 pm
From: John Machin <sjmac...@lexicon.net>
Date: Fri, 10 Feb 2012 15:49:43 -0800 (PST)
Local: Fri, Feb 10 2012 6:49 pm
Subject: Re: Formula Parse Error

and in any case COUNTIFS() is not available in XLS files. To see this for
yourself, fire up Excel 2007 or later, enter a formula with COUNTIFS in it,
and try to Save As Excel 97-2003 Workbook (*.xls)

If the users are not allowed to modify the workbook that you are creating,
you could avoid formulas and calculate the results in Python


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »