{"id":53,"date":"2026-02-10T17:55:11","date_gmt":"2026-02-10T09:55:11","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=53"},"modified":"2026-01-17T05:54:53","modified_gmt":"2026-01-17T05:54:53","slug":"how-to-enter-a1-style-formulas-using-formula-property-using-xlwings","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/how-to-enter-a1-style-formulas-using-formula-property-using-xlwings\/","title":{"rendered":"How To Enter A1 Style Formulas using Formula Property Using xlwings?"},"content":{"rendered":"<h2>Method<\/h2>\n<p style=\"margin: 0in; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 14.0pt;\">sht.Range(&#8216;C7&#8242;).Formula=&#8217;=$A$1+$A$5&#8217;<\/p>\n<h2>Sample Code<\/h2>\n\n\n<pre class=\"wp-block-code\"><code># Use `Formula` property for A1-style formulas\n\nimport xlwings as xw    #Import the xlwings package\nimport os    #Import the os package\n\nroot = os.getcwd()    #Get the current path\n#Create an Excel application window, visible, \n#without opening a workbook  \napp=xw.App(visible=True, add_book=False)\n#Open a data file, writable\nbk=app.books.open(fullname=root+r'\\Formula.xlsx',read_only=False)\nsht=bk.api.Sheets(1)    #Get the worksheet\n\n#Use `Formula` property for A1-style formulas\nsht.Range('C7').Formula='=$A$1+$A$5'\n\nbk.save('test.xlsx')\n#bk.close()\n#app.kill()<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"883\" height=\"482\" src=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/51.png\" alt=\"Enter A1 Style Formulas using Formula Property Using xlwings\" class=\"wp-image-350\" srcset=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/51.png 883w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/51-300x164.png 300w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/51-768x419.png 768w\" sizes=\"auto, (max-width: 883px) 100vw, 883px\" \/><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Method<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-53","post","type-post","status-publish","format-standard","hentry","category-xlwings-formula"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/53","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/comments?post=53"}],"version-history":[{"count":2,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/53\/revisions"}],"predecessor-version":[{"id":351,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/53\/revisions\/351"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=53"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=53"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=53"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}