Helper function to add spaces to excel formulas to improve readability. Can also add newlines based on a character or regular expression
Examples
formula_formater("(SUM(A1:A4)*5/11)/(B3-B4)")
#> [1] "( SUM( A1:A4 ) * 5 / 11 ) / ( B3 - B4 )"
formula_formater("(SUM(A1:A4)*5/11)/(B3-B4)", newline_breakpoint = "/")
#> [1] "( SUM( A1:A4 ) * 5 / \n11 ) / \n ( B3 - B4 )"
formula_formater("(SUM(A1:A4)*5/11)/(B3-B4)", newline_breakpoint = "[*-+/]")
#> [1] "( SUM( A1:A4 ) * \n5 / \n11 ) / \n ( B3 - B4 )"