Axlsx GEM: Uppercase font for a particular cell value

175 Views Asked by At

How can I convert a cell value to uppercase using AXLSX gem? I don't find any option from the docs (See Screenshot)

enter image description here

The problem is, when I try adding a formula to cell, the formula is taken in lowercase and doesn't seem to work (See Screenshot), but when I manually edit the formula in excel and make it uppercase, it starts working

enter image description here

CODE

cell.type = :string
cell.value = "=CEILING.MATH((K4+O4+C30)/3)"
cell.style = workbook.styles.add_style( { :alignment => { :vertical => :center, :wrap_text => true } } )

NOTE: I'm using LibreOffice in Ubuntu 18. Also, I'm aware of =UPPER(text). But, I don't understand how to apply it to a FORMULA.

1

There are 1 best solutions below

0
On

I couldn't find the exact solution, but, I found a workaround of formula. Now, this works on LibreOffice too

So, I used:

"=CEILING.MATH(((K4+O4+C30)/3), 1)"

instead of

"=CEILING.MATH((K4+O4+C30)/3)"

NOTE: I'm still waiting for someone to give actual answer to my question. I just shared this workaround, in case someone finds this helpful. But, I'll not accept this as answer.