AttributeError: 'Worksheet' object has no attribute 'formula_attributes'

42 views
Skip to first unread message

KrisC

unread,
Feb 10, 2023, 7:16:54 AM2/10/23
to openpyxl-users
Hi,

I've already import openpyxl, and I want to solve the @ sign in the array formula problem.

Here's my code: 
    sheet["Q2"] = "=QUARTILE.INC((J2:J13,L2:L13,N2:N13),1)"
    sheet.formula_attributes['Q2'] = {'t': 'array', 'ref': 'Q2:Q12'}

But it display error message: "AttributeError: 'Worksheet' object has no attribute 'formula_attributes'  "

I hope someone can help me soon,  thanks.

Charlie Clark

unread,
Feb 10, 2023, 7:34:12 AM2/10/23
to openpyxl-users
On 10 Feb 2023, at 13:16, KrisC wrote:

> Hi,
>
> I've already import openpyxl, and I want to solve the @ sign in the array
>
> formula problem.
>
> Here's my code:
>
> sheet["Q2"] = "=QUARTILE.INC((J2:J13,L2:L13,N2:N13),1)"
>
> sheet.formula_attributes['Q2'] = {'t': 'array', 'ref': 'Q2:Q12'}
>
> But it display error message: "AttributeError: 'Worksheet' object has no
>
> attribute 'formula_attributes' "

The API changed in 3.1 to make this easier. This was announced in the list back in 2021.

https://openpyxl.readthedocs.io/en/latest/simple_formulae.html#id1

Charlie

--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Sengelsweg 34
Düsseldorf
D- 40489
Tel: +49-203-3925-0390
Mobile: +49-178-782-6226

陳璽丞

unread,
Feb 10, 2023, 8:39:43 AM2/10/23
to openpyx...@googlegroups.com
Many thanks for your help!

Charlie Clark <charli...@clark-consulting.eu>於 2023年2月10日 週五,下午8:34寫道:
--
You received this message because you are subscribed to a topic in the Google Groups "openpyxl-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openpyxl-users/k5NW5xjzC_A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openpyxl-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openpyxl-users/15D4D2DF-9937-45CA-A556-BB3773B2B334%40clark-consulting.eu.
Reply all
Reply to author
Forward
0 new messages