Calc: Conditional decisions

Request For Enhancement, User feedback candidates for wiki
Post Reply
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Calc: Conditional decisions

Post by RoryOF »

One of the common problems that arises in Calc is that of multiple IF ... THEN decision trees. By way of illustration I give the link to the first such query today
http://user.services.openoffice.org/en/ ... =9&t=54853

I suggest that perhaps a more complex decision method ought be implemented for Calc, perhaps a CASE or SWITCH structure. Ideally, such a structure ought be integrated into the application itself, but pending that it might be possible to implement it as either a macro or an extension, where it prompted in some tabular form for the specified decision criteria and their corresponding actions, and turned these into the existing structures of the application, transparently to the User. It would be useful also to have an Undo mechanism which later reversed the code.

I don't do Calc, other than for simple table work, so am at the limits of my experience here, but I think that such an addition, however implemented, would be of use to uninformed Users.

Of course it could be argued that these multiple decision tables are bad programming logic. We have to remember that the majority of Calc Users are uninformed about the aesthetics of nice programming, and just want a quick (and even dirty!) method of achieving their goal, however unrealistic the goal and the method might be.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Calc: Conditional decisions

Post by Villeroy »

There is CHOOSE and there are the various lookup functions. Whenever people ask for a complex formula with IF, the best solution does not contain any IF. Quite often it is just a question of arithmetic to calculate a value by linear equation.
If you can't get the math right, VLOOKUP always provides a straight forward visual approach. Write down your requirement in a 2 column list, turn off regexes(in most cases) and do the vlookup (with 4 arguments in most cases).
If you can't do that, then you won't be able to handle any wizard neither. Somehow you've got to tell the machine about your data and intention what to do with it.
If VLOOKUP on 2 columns is too difficult then ... well ... ehem ... waiting may help. At least until most of the alcohol is absorbed.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply