[Solved] How to trigger a formula using text

Discuss the spreadsheet application

[Solved] How to trigger a formula using text

Postby Tinear » Sat May 09, 2020 5:14 pm

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/libr/libreoffice/libreoffice_5.2.7-1+deb9u11.dsc
Tinear
 
Posts: 6
Joined: Sat May 09, 2020 4:51 pm

Re: How to trigger a formula using text

Postby FJCC » Sat May 09, 2020 6:24 pm

In F3 you can use the formula
Code: Select all   Expand viewCollapse view
=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   Expand viewCollapse view
G3 + C3

What are you trying to accomplish?
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 7947
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: How to trigger a formula using text

Postby Tinear » Sat May 09, 2020 8:16 pm

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/libr/libreoffice/libreoffice_5.2.7-1+deb9u11.dsc
Tinear
 
Posts: 6
Joined: Sat May 09, 2020 4:51 pm

Re: How to trigger a formula using text

Postby Zizi64 » Sat May 09, 2020 9:24 pm

Code: Select all   Expand viewCollapse view
=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; LO6.1.6, 6.2.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.4.5;AOO4.1.7
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.
User avatar
Zizi64
Volunteer
 
Posts: 9718
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to trigger a formula using text

Postby Tinear » Sat May 09, 2020 9:43 pm

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/libr/libreoffice/libreoffice_5.2.7-1+deb9u11.dsc
Tinear
 
Posts: 6
Joined: Sat May 09, 2020 4:51 pm

Re: How to trigger a formula using text

Postby FJCC » Sat May 09, 2020 9:54 pm

If the only possible entries in D3 are yes and no, you can use
Code: Select all   Expand viewCollapse view
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
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 7947
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: How to trigger a formula using text

Postby Tinear » Sat May 09, 2020 10:16 pm

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/libr/libreoffice/libreoffice_5.2.7-1+deb9u11.dsc
Tinear
 
Posts: 6
Joined: Sat May 09, 2020 4:51 pm

Re: How to trigger a formula using text

Postby RusselB » Sat May 09, 2020 10:37 pm

In F3 enter the formula
Code: Select all   Expand viewCollapse view
if(D3="yes";C3/B3;"")

In H3 enter the formula
Code: Select all   Expand viewCollapse view
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.
User avatar
RusselB
Moderator
 
Posts: 6304
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: How to trigger a formula using text

Postby Tinear » Sun May 10, 2020 2:43 am

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/libr/libreoffice/libreoffice_5.2.7-1+deb9u11.dsc
Tinear
 
Posts: 6
Joined: Sat May 09, 2020 4:51 pm

Re: How to trigger a formula using text

Postby Tinear » Sun May 10, 2020 9:55 pm

: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/libr/libreoffice/libreoffice_5.2.7-1+deb9u11.dsc
Tinear
 
Posts: 6
Joined: Sat May 09, 2020 4:51 pm


Return to Calc

Who is online

Users browsing this forum: No registered users and 9 guests