Values in cells actually not formatted as well
See original GitHub issueHello. I set values for row and set format like this:
const row = worksheet.getRow(...);
row.numFmt = 'hh:mm';
row.values = userRec;
userRec is array of strings that represents time: [“10:51”,“10:56”,“10:46”] When I open created document, I see my data, formatted as I want, but: I want see sum of times, I type formula in cell =SUM(C7:D7) and see 00:00 In LibreOffice when I look in cell with tiimes I see there is symbol ’ infront of value, and when I remove it and hit enter - formula start to work. I have to do it with every cell. In MS Office I have no symbol ’ infront of value, but formula still don’t work, I have to click cell and hit enter - then formula works. That is how it looks after:
In both cases cell has right format “hh:mm” and time type. How can I fix this ?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6
Top Results From Across the Web
Fix text-formatted numbers by applying a number format
Technique 1: Convert text-formatted numbers by using Error Checking ; A large range of cells. Click the first cell in the range, and...
Read more >How to Fix Excel Numbers That Don't Add Up - Contextures
Right-click a blank cell, and click Copy · Select the cells that contain the "text" numbers · Right-click on one of the selected...
Read more >Excel format for number, text, scientific notation, accounting, etc.
In some cases, Excel may not display the cell value exactly as you've entered it, though the cell format is left as General....
Read more >Formatting problems – Data Organization in Spreadsheets for ...
Example: merging cells. Solution: If you're not careful, formatting a worksheet to be more aesthetically pleasing can compromise your computer's ability to see ......
Read more >Excel table not formatting new rows appropriately - Super User
To resolve this click on the header of a column then right click and choose "Format Cells" option and set the desired format....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The only way I managed to get durations working properly is by constructing the following date object as a value:
I believe it is something to do with how Excel stores dates (1900 / 1904 mode).
Little summary:
new Date(Date.UTC(1899, 11, 30, hours, minutes, seconds, 0))
construction really solve the issue. Thanks @tvoloshyn , but may I ask why 1899-11-30 ? I can’t found any tie to this date. Here is example:It gives perfect result:
Thanks!