[Solved] How to trigger a formula using text

Discuss the spreadsheet application
Post Reply
Tinear
Posts: 6
Joined: Sat May 09, 2020 4:51 pm

[Solved] How to trigger a formula using text

Post by Tinear »

I am very new to spreadsheets and not much of a computer person.

I have a column that is either 'yes' or 'no'.

Depending on which condition there is two different formulas.

So very roughly:

D3 is either 'yes' or 'no'

If 'yes' then F3 = C3/B3
If ' no' then G3 = G3 + C3
All help greatly appreciated.
Last edited by RusselB on Sun May 10, 2020 10:39 pm, edited 1 time in total.
Debian Stretch updated in the last month.

So it should be http://deb.debian.org/debian/pool/main/ ... eb9u11.dsc
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: How to trigger a formula using text

Post by FJCC »

In F3 you can use the formula

Code: Select all

=IF(D3 = "yes";C3/B3;"")
You cannot have a cell containing a reference to itself. Do you really mean for G3 to contain

Code: Select all

G3 + C3
What are you trying to accomplish?
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Tinear
Posts: 6
Joined: Sat May 09, 2020 4:51 pm

Re: How to trigger a formula using text

Post by Tinear »

Thanks for replying.

So looking at this again, there are two things that matter:

Is D3 "yes" or "no" and what happens with the value in C3.
As to G3 I could create another column deal with it,

So this would become:
If D3 = "no" then H3=G3+C3


I sort of had something similar to your IF formula, but I admit to being a bit lost with all the quotation marks.

=IF(D3 = "yes";C3/B3;"")


Effectively at the heart of the matter is, can you have two formulas in the same cell (D3) and use only one of them based on the text condition (yes or no) of that cell?

Pardon if I'm a bit scattered here. I have not had to think this way in several decades.
Debian Stretch updated in the last month.

So it should be http://deb.debian.org/debian/pool/main/ ... eb9u11.dsc
User avatar
Zizi64
Volunteer
Posts: 11353
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to trigger a formula using text

Post by Zizi64 »

Code: Select all

=IF(D3 = "yes";C3/B3;"")
The "yes" is a string of the condition. The "" is an empty string. This will be the result when the condition is false. You can replace it with an another result.

How to use the IF:
=IF(Condition ; Result for the True ; Result for the False)
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Tinear
Posts: 6
Joined: Sat May 09, 2020 4:51 pm

Re: How to trigger a formula using text

Post by Tinear »

Thank You for the reply.

Not sure I have grasped this entirely, but can I do:

D3 =IF(D3 = "yes";C3/B3; "no";H3 = G3+C3)
Debian Stretch updated in the last month.

So it should be http://deb.debian.org/debian/pool/main/ ... eb9u11.dsc
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: How to trigger a formula using text

Post by FJCC »

If the only possible entries in D3 are yes and no, you can use

Code: Select all

D3 =IF(D3 = "yes";C3/B3; G3+C3)
That means that if D3 contains yes, the cell will display C3/B3 otherwise it will display G3 + C3
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Tinear
Posts: 6
Joined: Sat May 09, 2020 4:51 pm

Re: How to trigger a formula using text

Post by Tinear »

Thanks for your reply.

And I got slightly off track a bit.
Ok, well I'm learning a little here and still not quite where I wish to be.

I think I may not be expressing my desire correctly.

What I am trying to do is have D3 = "yes" cause the formula F3 = C3/B3 to display in F3
and when D3 = "no" cause the formula H3 = G3 + C3 to display in H3
Debian Stretch updated in the last month.

So it should be http://deb.debian.org/debian/pool/main/ ... eb9u11.dsc
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: How to trigger a formula using text

Post by RusselB »

In F3 enter the formula

Code: Select all

if(D3="yes";C3/B3;"")
In H3 enter the formula

Code: Select all

if(D3="no";G3+H3;"")
Please note that if you enter something other than yes or no in D3, then both F3 and H3 will appear empty.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
Tinear
Posts: 6
Joined: Sat May 09, 2020 4:51 pm

Re: How to trigger a formula using text

Post by Tinear »

Thank you for your reply.

Think I learned a little something else with this answer, regarding how to look at the problem and from my own field, which can involve a lot of troubleshooting, this is huge part of the issue. Also learning some new, for me, lingo.

I won't have chance to try this out tonight, but all being well sometime tomorrow.

All greatly appreciated.

Stay Safe
Debian Stretch updated in the last month.

So it should be http://deb.debian.org/debian/pool/main/ ... eb9u11.dsc
Tinear
Posts: 6
Joined: Sat May 09, 2020 4:51 pm

Re: How to trigger a formula using text

Post by Tinear »

:bravo:

Thanks to all whom answered. I have learned a few things and ultimately this is what you want. This situation has been resolved.
Debian Stretch updated in the last month.

So it should be http://deb.debian.org/debian/pool/main/ ... eb9u11.dsc
Post Reply