Coder Social home page Coder Social logo

Comments (5)

KeesBleijenberg avatar KeesBleijenberg commented on August 17, 2024 1

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.

qrilka avatar qrilka commented on August 17, 2024

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.

KeesBleijenberg avatar KeesBleijenberg commented on August 17, 2024

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
excelNL

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.

qrilka avatar qrilka commented on August 17, 2024

@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:

  1. 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 -
sum

from xlsx.

qrilka avatar qrilka commented on August 17, 2024

NP, this helped me learn something new :)
Not quite sure how useful this "feature" is though...
Closing then.

from xlsx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.