Comments (5)
I thought this had to do with the language of Office. But it's a consequence of the language settings in the OS.
Look at https://edu.gcfglobal.org/en/excel-tips/understanding-regional-differences-in-excel/1/
Problem solved. Sorry for the confusion.
from xlsx.
Hi @KeesBleijenberg I'm not that available this week because of my vacation but adding some test files and code you're using could be helpful. By itself the library doesn't do anything (or at least shouldn't do anything) to transform what's is in the files themselves. In practice you could just open the file in question as a zip archive and see what's is in its XML.
from xlsx.
Enjoy your vacation!
Hi @KeesBleijenberg I'm not that available this week because of my vacation but adding some test files and code you're using could be helpful. By itself the library doesn't do anything (or at least shouldn't do anything) to transform what's is in the files themselves. In practice you could just open the file in question as a zip archive and see what's is in its XML.
This is the xlsx
test.xlsx
This is a screendump of creating the cell in a Dutch version of xlsx
The test program is below. The output is "SUM(3,4)"
module Main (main)
where
import Codec.Xlsx
import qualified Data.ByteString.Lazy as L
import Data.Map as M
main :: IO ()
main = do
let fn = "/home/kees/testXlsx/test.xlsx"
bs <- L.readFile fn
let xlsx = toXlsx bs
let ws = _wsCells $ snd $ head $ _xlSheets xlsx
cell = ws M.! (RowIndex 1, ColumnIndex 1) :: Cell
case _cellFormula cell of
Just f -> case _cellfExpression f of
NormalFormula fTxt -> print $ unFormula fTxt
_ -> error "error"
Nothing -> error "error"
from xlsx.
@KeesBleijenberg in the file I see this formula with a comma:
$ unzip -p Downloads/test.xlsx xl/worksheets/sheet1.xml ; echo
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"><dimension ref="A1"/><sheetViews><sheetView tabSelected="1" workbookViewId="0"/></sheetViews><sheetFormatPr defaultRowHeight="15" x14ac:dyDescent="0.25"/><sheetData><row r="1" spans="1:1" x14ac:dyDescent="0.25"><c r="A1"><f>SUM(3,4)</f><v>7</v></c></row></sheetData><pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/></worksheet>
And in Overview of formulas I read:
- Structure. The structure of a function begins with an equal sign (=), followed by the function name, an opening parenthesis, the arguments for the function separated by commas, and a closing parenthesis.
So it looks like Excel just corrects your not quite correct formula. I found only the following about semicolons on that page:
Separate values in different rows by using semicolons (;). For example, to represent the values 10, 20, 30, and 40 in one row and 50, 60, 70, and 80 in the row immediately below, you enter a 2-by-4 array constant: {10,20,30,40;50,60,70,80}.
This doesn't seem to have anything to do with the library itself as it's a "feature" of Excel itself. E.g. in LibreOffice I see "SUM(3,4)" when opening this file, the same in Office 365. And Google Sheets uses semicolon as a separator, so I see "SUM(3;4)" when opening this file.
Office 365 shows "=SUM(1;2)" as invalid formula when I try to enter it -
from xlsx.
NP, this helped me learn something new :)
Not quite sure how useful this "feature" is though...
Closing then.
from xlsx.
Related Issues (20)
- Writing default stylesheet to file results in excel complaining it's invalid HOT 9
- microlens flag still builds lens as a dependency
- Hyperlink Support HOT 7
- Leaking merge information across worksheets HOT 1
- Handling dates before 1900-03-01 HOT 3
- Add newtype for column and row indexes
- Add integration test that checks correctness with xlsx validator
- Support lens v5.1 HOT 5
- Hackage docs are broken HOT 9
- We shouldn't be able to make sheetnames bigger then 31 characters. HOT 1
- Cell Range dataValidation problem HOT 5
- Still applying code formatting? HOT 4
- Proper support for cross-sheet references, was "Errors creating pivot tables in separate sheets" HOT 4
- Test files missing in sdist HOT 4
- Request: Minimal working example for styles HOT 3
- Cut a release with GHC 9.6 support HOT 5
- Sheets not found due to sheets being referenced by absolute path. HOT 4
- fails to build in Stackage LTS HOT 5
- Parse Numbers as Scientific, not Double HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xlsx.