Change False?

Discuss the spreadsheet application

Change False?

Postby dawidek990 » Sat Jan 19, 2019 2:56 pm

Is it possible to do something instead of "False" in the formula, for example, an empty cell or the text that I want to introduce?
e.g. in the formula = IF(D =M$2;B2) or others? ;]
greetings ;]
OpenOffice 4.1.6 Windows 10
dawidek990
 
Posts: 21
Joined: Thu Dec 13, 2018 10:27 am

Re: Change False?

Postby Zizi64 » Sat Jan 19, 2019 3:40 pm

For a text:
Code: Select all   Expand viewCollapse view
= IF(D2=M$2;B2;"The case, when it is not True")


For a VISUALLY empty cell (a cell is never EMPTY, when it contains a FORMULA):
Code: Select all   Expand viewCollapse view
= IF(D2=M$2;B2;"")
Tibor Kovacs, Hungary; LO4.4.7, LO6.1.5 on Win7-10 x64Prof.
PortableApps, winPenPack: LO3.3.0-6.2.2; AOO4.1.5
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: 7914
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Change False?

Postby dawidek990 » Sat Jan 19, 2019 4:16 pm

ok is working, but what about #N/A?
like COUNTIF(A2:A50; A2)(some like: if true = ok, if flas = " ")
or VLOOKUP(L2;MyTitle;1;0)
or =r2=s2 (as above)
or ISTEXT(a1) (as above)

is working too?
OpenOffice 4.1.6 Windows 10
dawidek990
 
Posts: 21
Joined: Thu Dec 13, 2018 10:27 am

Re: Change False?

Postby FJCC » Sat Jan 19, 2019 5:58 pm

The formula
Code: Select all   Expand viewCollapse view
COUNTIF(A2:A50; A2)

doesn't make a lot of sense since A2 is both the criterion to be searched for and part of the search range. In any case, are you looking for
Code: Select all   Expand viewCollapse view
IF(COUNTIF(A2:A50; A2);"ok"; "")

which will show ok if the COUNTIF returns something other than zero.
Similarly, your VLOOKUP returns a value from the search column. But if VLOOKUP might return #N/A, you can use the ISNA() function.
Code: Select all   Expand viewCollapse view
IF(ISNA(VLOOKUP(L2;MyTitle;1;0));"";VLOOKUP(L2;MyTitle;1;0))
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: 7130
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Change False?

Postby dawidek990 » Sat Jan 19, 2019 6:48 pm

ok this two is working... but what to do if i have: IF(COUNTIF(A2:A50; B2);"ok"; " ")
and in B2 is #N/A then result is #N/A, not " "
OpenOffice 4.1.6 Windows 10
dawidek990
 
Posts: 21
Joined: Thu Dec 13, 2018 10:27 am

Re: Change False?

Postby FJCC » Sat Jan 19, 2019 7:17 pm

If you want to handle the case of #N/A in B2 and see either a blank cell or ok, use
Code: Select all   Expand viewCollapse view
=IF(ISNA(COUNTIF(A2:A50; B2));""; "ok ")

If you want to see the result of the COUNTIF, use
Code: Select all   Expand viewCollapse view
=IF(ISNA(COUNTIF(A2:A50; B2));""; COUNTIF(A2:A50; B2))
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: 7130
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Change False?

Postby Zizi64 » Sat Jan 19, 2019 7:20 pm

ok this two is working... but what to do if i have: IF(COUNTIF(A2:A50; B2);"ok"; " ")
and in B2 is #N/A then result is #N/A, not " "

Then you must use more conditions:
There is a function named ISNA(). Use it to determine if an input parameter is valid or not.
Tibor Kovacs, Hungary; LO4.4.7, LO6.1.5 on Win7-10 x64Prof.
PortableApps, winPenPack: LO3.3.0-6.2.2; AOO4.1.5
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: 7914
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Change False?

Postby RusselB » Sat Jan 19, 2019 9:53 pm

The #N/A is an error message, and all error messages, when generated via a formula, take precedence over the normal returns of that formula.
ie: a formula that returns #N/A will show #N/A, rather than the "" you are expecting from your formula.
To include the ISNA function, with your formula, you have to check that first, so your formula could look like
Code: Select all   Expand viewCollapse view
=if(isna(countif(A2:A50;B2));"";"OK")
OpenOffice 4.1.6 and LibreOffice 6.0.6.2 on Windows 7 Pro & Ultimate
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.
RusselB
Volunteer
 
Posts: 5018
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Change False?

Postby dawidek990 » Sun Jan 20, 2019 4:14 pm

okey, there is a problem with =if(isna(countif(A2:A50;B2));"";(A2:A50;B2))
there is no #N/A is ok, if it finds B2 entries in column A ... it shows "1" but if it does not find "0" shows.

The question is, why the autofilter does not show 0?
Can I change 0? ew to do so that the autofilter can see 0?
OpenOffice 4.1.6 Windows 10
dawidek990
 
Posts: 21
Joined: Thu Dec 13, 2018 10:27 am

Re: Change False?

Postby Zizi64 » Sun Jan 20, 2019 5:35 pm

Please upload your ODF type sample file here.
Tibor Kovacs, Hungary; LO4.4.7, LO6.1.5 on Win7-10 x64Prof.
PortableApps, winPenPack: LO3.3.0-6.2.2; AOO4.1.5
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: 7914
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Change False?

Postby RusselB » Sun Jan 20, 2019 5:37 pm

When did autofilter get introduced to this problem?
Autofilter, like all of the filters, shows just the rows that match the filter.
I hate auto-filter and always use the Standard Filter, as I find it gives me much more control over the information to be shown.

Your current problem does not match (any longer) the original topic, so, technically you should mark this one as Solved, then start a new topic with this new problem.
There are several topics regarding auto-filter already on the forums, so I'm going to suggest you check them before starting a new topic.
OpenOffice 4.1.6 and LibreOffice 6.0.6.2 on Windows 7 Pro & Ultimate
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.
RusselB
Volunteer
 
Posts: 5018
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON


Return to Calc

Who is online

Users browsing this forum: No registered users and 14 guests