Trouble using the IF statement in a Writer table

classic Classic list List threaded Threaded
3 messages Options
Patrick Dijkgraaf Patrick Dijkgraaf
Reply | Threaded
Open this post in threaded view
|

Trouble using the IF statement in a Writer table

Hi all,

I'm trying to use the IF statement in a Writer table, but it doesn't
behave the way I expect.
Probably I am doing something wrong. Can any of you help me?

Example document: http://kwek.duckstad.net/IFstatement.odt

What I'm trying to achieve (in cell B1) is to print the value of cell A1
up to a maximum of 8. I thought the formula in cell B1 woud to that:
   - If the value in cell A1 is larger than 8, print the number 8.
   - Otherwise, print the content of cell A1.

But strangely enough, It always prints the content of cell A1,
regardless of the value. Can anyone tell me what I'm doing wrong?

Thanks in advance!

--
Cheers,
Patrick


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Brian Barker Brian Barker
Reply | Threaded
Open this post in threaded view
|

Re: Trouble using the IF statement in a Writer table

At 10:51 21/02/2015 +0100, Patrick Dijkgraaf wrote:
>I'm trying to use the IF statement in a Writer table, but it doesn't
>behave the way I expect. Probably I am doing something wrong. Can
>any of you help me?

Only a limited range of functions is available in Writer tables and,
as far as I know, this does not include IF.

>What I'm trying to achieve (in cell B1) is to print the value of
>cell A1 up to a maximum of 8. I thought the formula in cell B1 [
>=IF(<A1>>8;8;<A1>) ]would to that:
>  - If the value in cell A1 is larger than 8, print the number 8.
>  - Otherwise, print the content of cell A1.

You can achieve the effect you require using
=MIN<A1>|8

I trust this helps.

Brian Barker


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Patrick Dijkgraaf Patrick Dijkgraaf
Reply | Threaded
Open this post in threaded view
|

Re: Trouble using the IF statement in a Writer table

That works like a charm, thanks Brian!

--
Cheers,
Patrick

On Sat, 2015-02-21 at 11:00 +0000, Brian Barker wrote:

> At 10:51 21/02/2015 +0100, Patrick Dijkgraaf wrote:
> >I'm trying to use the IF statement in a Writer table, but it doesn't
> >behave the way I expect. Probably I am doing something wrong. Can
> >any of you help me?
>
> Only a limited range of functions is available in Writer tables and,
> as far as I know, this does not include IF.
>
> >What I'm trying to achieve (in cell B1) is to print the value of
> >cell A1 up to a maximum of 8. I thought the formula in cell B1 [
> >=IF(<A1>>8;8;<A1>) ]would to that:
> >  - If the value in cell A1 is larger than 8, print the number 8.
> >  - Otherwise, print the content of cell A1.
>
> You can achieve the effect you require using
> =MIN<A1>|8
>
> I trust this helps.
>
> Brian Barker
>
>

--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted