summaryrefslogtreecommitdiffhomepage
path: root/examples/escape_formula_example.md
diff options
context:
space:
mode:
Diffstat (limited to 'examples/escape_formula_example.md')
-rw-r--r--examples/escape_formula_example.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/examples/escape_formula_example.md b/examples/escape_formula_example.md
new file mode 100644
index 00000000..fb23ce66
--- /dev/null
+++ b/examples/escape_formula_example.md
@@ -0,0 +1,27 @@
+## Description
+
+You could escape formulas
+
+## Code
+
+```ruby
+require 'axlsx'
+
+p = Axlsx::Package.new
+wb = p.workbook
+
+wb.add_worksheet(name: 'Escaping Formulas') do |sheet|
+ sheet.add_row [1, 2, 3, '=SUM(A2:C2)'], escape_formulas: true
+ sheet.add_row [
+ '=IF(2+2=4,4,5)',
+ '=IF(13+13=4,4,5)',
+ '=IF(99+99=4,4,5)'
+ ], escape_formulas: [true, false, true]
+end
+
+p.serialize 'escape_formula_example.xlsx'
+```
+
+## Output
+
+![Output](images/escape_formula_example.png "Output")