Gian Hancock 655d663590 FIX: Make XOR, OR, AND functions more consistent with Excel
The way these functions interpret their arguments is inconsistent with
Excel in a few ways:

- EmptyCell: Excel ignores arguments evaluating to these types of
  values, treating them as if they didn't exist.

- Text: Text cells are ignored unless they are "TRUE" or "FALSE" (case
  insensitive). EXCEPT if the string value comes from a reference, in
  which case it is always ignored regardless of its value.

- Error if no args: Excel returns a #VALUE! error for these functions if
  no arguments are provided, or if all arguments are ignored (see
  above).

- EmptyArg: Bizarrely, Unlike EmptyCell, EmptyArg is not ignored and is
  treated as if it were FALSE by Excel.

- ErrorPropagation: Excel propagates errors in the arguments and in
  cells belonging to any Range arguments.

Additionally, these functions are not consistent with each other, XOR,
OR, AND vary in how they handle the cases mentioned above.

Rectify these consistency issues by re-implementing them all in terms of
a single base function which is more consistent with Excel behavior.
2024-12-26 15:06:54 +01:00
2024-04-27 18:02:04 +02:00
2024-12-26 15:06:54 +01:00
2024-04-25 19:42:10 +02:00
2024-09-21 11:58:50 +02:00
2024-03-04 23:04:50 +01:00
2023-11-20 10:46:19 +01:00

IronCalc

MIT licensed Apache 2.0 licensed Build Status Code coverage docs-badge Discord chat

IronCalc is a new, modern, work-in-progress spreadsheet engine and set of tools to work with spreadsheets in diverse settings.

This repository contains the main engine and the xlsx reader and writer.

Programmed in Rust, you will be able to use it from a variety of programming languages like Python, JavaScript (wasm), nodejs and possibly R, Julia or Go.

We will build different skins: in the terminal, as a desktop application or use it in you own web application.

Building

cargo build --release

Testing, linting and code coverage

Test are run automatically and test coverage can always be found in codecov

If you want to run the tests yourself:

make tests

Note that this runs unit tests, integration tests, linter tests and formatting tests.

If you want to run the code coverage yourself:

make coverage
cd target/coverage/html/
python -m http.server

API Documentation

Documentation is published at: https://docs.rs/ironcalc/latest/ironcalc/

It might be generated locally

$ make docs
$ cd target/doc
$ python -m http.server

And visit http://0.0.0.0:8000/ironcalc/

Simple example

Add the dependency to Cargo.toml:

[dependencies]
ironcalc = { git = "https://github.com/ironcalc/IronCalc", version = "0.1"}

And then use this code in main.rs:

use ironcalc::{
    base::{expressions::utils::number_to_column, model::Model},
    export::save_to_xlsx,
};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut model = Model::new_empty("hello-calc.xlsx", "en", "UTC")?;
    // Adds a square of numbers in the first sheet
    for row in 1..100 {
        for column in 1..100 {
            let value = row * column;
            model.set_user_input(0, row, column, format!("{}", value));
        }
    }
    // Adds a new sheet
    model.add_sheet("Calculation")?;
    // column 100 is CV
    let last_column = number_to_column(100).unwrap();
    let formula = format!("=SUM(Sheet1!A1:{}100)", last_column);
    model.set_user_input(1, 1, 1, formula);

    // evaluates
    model.evaluate();

    // saves to disk
    save_to_xlsx(&model, "hello-calc.xlsx")?;
    Ok(())
}

See more examples in the examples folder of the xlsx crate.

ROADMAP

See https://github.com/ironcalc

Early testing

An early preview of the technology running entirely in your browser:

https://app.ironcalc.com

Collaborators needed!. Call to action

We don't have a vibrant community just yet. This is the very stages of the project. But if you are passionate about code with high standards and no compromises, if you are looking for a project with high impact, if you are interested in a better, more open infrastructure for spreadsheets, whether you are a developer (rust, python, TypeScript, electron/tauri/anything else native app, React, you name it), a designer, an Excel power user who wants features, a business looking to integrate a MIT/Apache licensed spreadsheet in your own SaaS application join us!

The best place to start will be to join or discord channel or send us an email at hello@ironcalc.com.

Many have said it better before me:

Folks wanted for hazardous journey. Low wages, bitter cold, long hours of complete darkness. Safe return doubtful. Honour and recognition in event of success.

License

Licensed under either of

at your option.

Description
No description provided
Readme 10 MiB
Languages
Rust 85%
TypeScript 13.9%
JavaScript 0.6%
Dockerfile 0.1%
Python 0.1%