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!
Laurie Hartley
Posts: 93
Joined: Mon Feb 27, 2017 5:33 am

If function / Spreadsheet

Postby Laurie Hartley » 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?

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 390 times
vocx
Posts: 4334
Joined: Thu Oct 18, 2018 9:18 pm

Re: If function / Spreadsheet

Postby vocx » Fri Jan 24, 2020 6:55 am

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.
To support the documentation effort, and code development, your donation is appreciated: paypal.
Laurie Hartley
Posts: 93
Joined: Mon Feb 27, 2017 5:33 am

Re: If function / Spreadsheet

Postby Laurie Hartley » Fri Jan 24, 2020 7:40 am

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

Postby eivindkvedalen » Fri Jan 24, 2020 7:54 am

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: 93
Joined: Mon Feb 27, 2017 5:33 am

Re: If function / Spreadsheet

Postby Laurie Hartley » Fri Jan 24, 2020 10:53 am

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

Re: If function / Spreadsheet

Postby Laurie Hartley » Sat Feb 08, 2020 3:23 am

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
Posts: 1402
Joined: Thu Dec 27, 2018 12:28 pm

Re: If function / Spreadsheet

Postby Roy_043 » Sat Feb 08, 2020 10:11 am

Laurie Hartley
Posts: 93
Joined: Mon Feb 27, 2017 5:33 am

Re: If function / Spreadsheet

Postby Laurie Hartley » Tue Feb 11, 2020 11:25 pm

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