If function / Spreadsheet

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
Laurie Hartley
Posts: 522
Joined: Mon Feb 27, 2017 5:33 am
Location: Australia

If function / Spreadsheet

Post by Laurie Hartley »

Is there a list of functions with syntax for the spreadsheet. I would particularly like to use the "if" function. Not having much luck so far - is it my syntax?

OS: Windows 8.1 (6.3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19239 (Git)
Build type: Release
Branch: master
Hash: 49e4e45ff38b0459f0f9a76df634f6da4995b731
Python version: 3.7.3
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
Attachments
If.JPG
If.JPG (149.38 KiB) Viewed 2512 times
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: If function / Spreadsheet

Post by vocx »

Laurie Hartley wrote: Fri Jan 24, 2020 6:44 am Is there a list of functions with syntax for the spreadsheet. I would particularly like to use the "if" function. Not having much luck so far - is it my syntax?
The Spreadsheet Workbench is not a full LibreOffice document, yo.

The most complete information that I know about, which still looks a bit incomplete, is the Expressions page. The Spreadsheet Workbench is basically a graphical interface to the Expression Engine described in that page.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Laurie Hartley
Posts: 522
Joined: Mon Feb 27, 2017 5:33 am
Location: Australia

Re: If function / Spreadsheet

Post by Laurie Hartley »

vocx wrote: Fri Jan 24, 2020 6:55 am

The Spreadsheet Workbench is not a full LibreOffice document, yo.

The most complete information that I know about, which still looks a bit incomplete, is the Expressions page. The Spreadsheet Workbench is basically a graphical interface to the Expression Engine described in that page.

Thanks vocx - I will check out.
eivindkvedalen
Posts: 602
Joined: Tue Jan 29, 2013 10:35 pm

Re: If function / Spreadsheet

Post by eivindkvedalen »

Laurie Hartley wrote: Fri Jan 24, 2020 6:44 am Is there a list of functions with syntax for the spreadsheet. I would particularly like to use the "if" function. Not having much luck so far - is it my syntax?
You can express "if" using the ? : operator

condition ? if-true : if-false

e.g you can use it like this in a cell:

=A1 > B1 ? C1 : D1

Eivind
Laurie Hartley
Posts: 522
Joined: Mon Feb 27, 2017 5:33 am
Location: Australia

Re: If function / Spreadsheet

Post by Laurie Hartley »

Thanks Eivind - I will try that.
Laurie Hartley
Posts: 522
Joined: Mon Feb 27, 2017 5:33 am
Location: Australia

Re: If function / Spreadsheet

Post by Laurie Hartley »

eivindkvedalen wrote: Fri Jan 24, 2020 7:54 am You can express "if" using the ? : operator

condition ? if-true : if-false

e.g you can use it like this in a cell:

=A1 > B1 ? C1 : D1

Eivind I tried that and it worked like a charm!!!! 8-) You have opened up a whole new world for me. If you can suggest any other logical or "look up" functions I would be very grateful!!! :D
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: If function / Spreadsheet

Post by Roy_043 »

Laurie Hartley
Posts: 522
Joined: Mon Feb 27, 2017 5:33 am
Location: Australia

Re: If function / Spreadsheet

Post by Laurie Hartley »

Roy_043 wrote: Sat Feb 08, 2020 10:11 am This may be of interest:
Workarounds for logical operators AND and OR
Thanks Roy I will check this out
Post Reply