The officially official Devuan Forum!

You are not logged in.

#1 2023-10-06 08:50:46

swanson
Member
Registered: 2020-04-22
Posts: 104  

Gnumeric Logic problem

I've got to evaluate the strings of weekdays in Gnumeric- Mon, Tue, Wed, Thurs.... - and IF it is Sat OR Sun the result should be "0" or else it should be "1".

This far is OK; =if(B279<>"Sat";"1";"0") it prints "0" for true and "1" for false .

But this does not work: =ifs(B280<>"Sun";"0";B280<>"Sat";"0";B280<>"Mon";"1") it prints "0" every time. (Note IFS function)

It's a work schedule and it's keeping track of my days worked, hours, salary and stuff for each month. The week days are listed in a column.

Sorry to bother you all with this, but googling gives Excel and VBA hits that don't tell me much. Gnumeric man pages just gives me bare basics.

PS I'm not a student!!!!!

Offline

#2 2023-10-06 12:40:48

boughtonp
Member
From: UK
Registered: 2023-01-19
Posts: 212  
Website

Re: Gnumeric Logic problem

swanson wrote:

I've got to evaluate the strings of weekdays in Gnumeric- Mon, Tue, Wed, Thurs.... - and IF it is Sat OR Sun the result should be "0" or else it should be "1".

So why are you not doing exactly what you said?

i.e. Using OR and testing that the cell is Sat or that the cell is Sun, rather than over-complicating things with inequality!?

Except you probably don't even need to do this manually...

It's a work schedule and it's keeping track of my days worked, hours, salary and stuff for each month. The week days are listed in a column.

There are already functions to work with WORKDAYs, or to tell you the NET WORKDAYS - i.e. the number of workdays in a range, remembering that a range can have a length of one, if that is actually necessary.

Last edited by boughtonp (2023-10-06 12:42:24)


3.1415P265E589T932E846R64338

Offline

#3 2023-10-25 12:29:06

swanson
Member
Registered: 2020-04-22
Posts: 104  

Re: Gnumeric Logic problem

Finally my two brain cells got it! Thank you!

=if(or(B281="Sat";B281="Sun");"0";"1")

(Sry for the very late answer)

Offline

Board footer