Change False?

Discuss the spreadsheet application
Post Reply
dawidek990
Posts: 55
Joined: Thu Dec 13, 2018 10:27 am

Change False?

Post by dawidek990 »

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
User avatar
Zizi64
Volunteer
Posts: 11353
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Change False?

Post by Zizi64 »

For a text:

Code: Select all

= 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

= IF(D2=M$2;B2;"")
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.
dawidek990
Posts: 55
Joined: Thu Dec 13, 2018 10:27 am

Re: Change False?

Post by dawidek990 »

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
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Change False?

Post by FJCC »

The formula

Code: Select all

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

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

IF(ISNA(VLOOKUP(L2;MyTitle;1;0));"";VLOOKUP(L2;MyTitle;1;0))
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.
dawidek990
Posts: 55
Joined: Thu Dec 13, 2018 10:27 am

Re: Change False?

Post by dawidek990 »

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
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Change False?

Post by FJCC »

If you want to handle the case of #N/A in B2 and see either a blank cell or ok, use

Code: Select all

 =IF(ISNA(COUNTIF(A2:A50; B2));""; "ok ")
If you want to see the result of the COUNTIF, use

Code: Select all

=IF(ISNA(COUNTIF(A2:A50; B2));""; COUNTIF(A2:A50; B2))
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.
User avatar
Zizi64
Volunteer
Posts: 11353
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Change False?

Post by Zizi64 »

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; 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.
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Change False?

Post by RusselB »

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

=if(isna(countif(A2:A50;B2));"";"OK")
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.
dawidek990
Posts: 55
Joined: Thu Dec 13, 2018 10:27 am

Re: Change False?

Post by dawidek990 »

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
User avatar
Zizi64
Volunteer
Posts: 11353
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Change False?

Post by Zizi64 »

Please upload your ODF type sample file here.
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.
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Change False?

Post by RusselB »

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.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.
Post Reply