I'm using closedxml to generate a excel file. I'm mapping the cells directly in excel by creating a named range and inside of it reaching the items in the range by {{item.property}}, the range collection is added like a variable in the code.
The item I'm using has a Year property and a month property, the mapping in that excel cell is: {{item.Yr}}/{{item.Mon}}.
I would like Excel to format the value in the cell to mmm-yyyy (Jan-2020). Which it does if I directly write a date in the cell in Excel and presses Enter, but that's not what I want, I want it to format my generated value.
I've tried using the functions like =TEXT(date,format) or =DATEVALUE("1/1/2015").
But the problem is that I can't write directly "1/1/2015", I need to write something like DATEVALUE(1/{{item.Mon}}/{{item.Yr}} but Excel syntax doesn't allow this. Ofcourse I've also tried just the "format cell" to date on the cell, but doesn't work (only if I directly type a date and presses Enter)
I'm sorry for my crappy explanation. I hope someone understands what I mean and what I want to accomplish.
=Date({{item.Yr}},{{item.Mon}},1)then format as desired. - Scott Craner