ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   What does this mean?? (https://www.excelbanter.com/excel-discussion-misc-queries/185104-what-does-mean.html)

James

What does this mean??
 
Using these forums (which are absolutely brilliant!) I have built the
following formula:

=IF(MID($M6,1,1)="x","",IF(--(COUNTIF($B$17:$B$108,N$4)0)=1,"#",""))

I now have the problem of trying to explain what this does, but that my
question, could someone give me an explanation of what this formula is
saying, in particular the -- section?

Many thanks
--
J

Dave Peterson

What does this mean??
 
First, the =countif()0 will return a true/false.
the -- stuff in front of it will change the true/false to 1/0.

So instead of checking for 1 = 1, you could just check for true = true.

If fact, you could just drop the = true portion:

=IF(MID($M6,1,1)="x","",IF(COUNTIF($B$17:$B$108,N$ 4)0,"#",""))

If the first character in M6 = "x" then
show nothing ("")
else
if there's at least one value equal to N4 in B17:B108 then
show "#"
else
show nothing ("")
end if
end if

I would have used:
=IF(left($M6,1)="x","",IF(COUNTIF($B$17:$B$108,N$4 )0,"#",""))

(just because =left() is easier to see that I'm testing the first character.)

James wrote:

Using these forums (which are absolutely brilliant!) I have built the
following formula:

=IF(MID($M6,1,1)="x","",IF(--(COUNTIF($B$17:$B$108,N$4)0)=1,"#",""))

I now have the problem of trying to explain what this does, but that my
question, could someone give me an explanation of what this formula is
saying, in particular the -- section?

Many thanks
--
J


--

Dave Peterson

James

What does this mean??
 
Thanks Dave,

I will give your formula version a go. It also makes it easier to re-enter
should anything go wrong.

Thanks
--
J


"Dave Peterson" wrote:

First, the =countif()0 will return a true/false.
the -- stuff in front of it will change the true/false to 1/0.

So instead of checking for 1 = 1, you could just check for true = true.

If fact, you could just drop the = true portion:

=IF(MID($M6,1,1)="x","",IF(COUNTIF($B$17:$B$108,N$ 4)0,"#",""))

If the first character in M6 = "x" then
show nothing ("")
else
if there's at least one value equal to N4 in B17:B108 then
show "#"
else
show nothing ("")
end if
end if

I would have used:
=IF(left($M6,1)="x","",IF(COUNTIF($B$17:$B$108,N$4 )0,"#",""))

(just because =left() is easier to see that I'm testing the first character.)

James wrote:

Using these forums (which are absolutely brilliant!) I have built the
following formula:

=IF(MID($M6,1,1)="x","",IF(--(COUNTIF($B$17:$B$108,N$4)0)=1,"#",""))

I now have the problem of trying to explain what this does, but that my
question, could someone give me an explanation of what this formula is
saying, in particular the -- section?

Many thanks
--
J


--

Dave Peterson



All times are GMT +1. The time now is 05:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com