ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   smaller equations: a & b, or just a.. (https://www.excelbanter.com/excel-discussion-misc-queries/68087-smaller-equations-b-just.html)

nastech

smaller equations: a & b, or just a..
 
don't know it this can work, but
i have working, long equations that break down into basically 3parts:
If switch is set, then a & b, else just a. That is a repetition I am trying
to get rid of.

basically have: =IF($ab$2="x",AND(A=C,B=C),A=C)

trying to get rid of using a=c twice, thanks..
(a can stand alone, but b must be anded with a)
maybe something like:
=AND(A=C,IF($ab$2="x",b=c)) but 2nd part comes up as false, so not work..
=AND(A=C,IF($ab$2<"x","",b=c)



bpeltzer

smaller equations: a & b, or just a..
 
=and(a=c,if($ab2="x",b=c,true)).


"nastech" wrote:

don't know it this can work, but
i have working, long equations that break down into basically 3parts:
If switch is set, then a & b, else just a. That is a repetition I am trying
to get rid of.

basically have: =IF($ab$2="x",AND(A=C,B=C),A=C)

trying to get rid of using a=c twice, thanks..
(a can stand alone, but b must be anded with a)
maybe something like:
=AND(A=C,IF($ab$2="x",b=c)) but 2nd part comes up as false, so not work..
=AND(A=C,IF($ab$2<"x","",b=c)



Dana DeLouis

smaller equations: a & b, or just a..
 
trying to get rid of using a=c twice

I think if you factor out a=c, it reduces to this:

=AND(a=c,OR(b=c, $ab$2<"x") )

Hope I got it right :)
--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"nastech" wrote in message
...
don't know it this can work, but
i have working, long equations that break down into basically 3parts:
If switch is set, then a & b, else just a. That is a repetition I am
trying
to get rid of.

basically have: =IF($ab$2="x",AND(A=C,B=C),A=C)

trying to get rid of using a=c twice, thanks..
(a can stand alone, but b must be anded with a)
maybe something like:
=AND(A=C,IF($ab$2="x",b=c)) but 2nd part comes up as false, so not work..
=AND(A=C,IF($ab$2<"x","",b=c)





[email protected]

smaller equations: a & b, or just a..
 
"nastech" wrote:
i have working, long equations [...].
basically have: =IF($ab$2="x",AND(A=C,B=C),A=C)
trying to get rid of using a=c twice


You do not explain why. If you merely want to avoid typing,
any of the methods suggested so far will suffice. But you
might also want consider the cost of evaluating formulas
unnecessarily, if they are "long equations" or invoke costly
functions. To minimize that, I believe you want to stick with
the IF() form, but change the order of testing.

=if(A=C, or(B=C, $ab$2<"x"), false)

When A=C is false, that avoids evaluating B=C while also
reducing typing. Even more efficient:

=if(A=C, if($ab$2<"x", true, B=C), false)

The point is: AND() and OR() functions evaluate all
parameters, whereas IF() evaluates only the appropriate
true-part or false-part depending on the value of the
conditional expression. Arguably, usually it is not a big deal.

nastech

smaller equations: a & b, or just a..
 
Thanks-all ! ! These answers all look good, and should all be right, as was
wondering about use of true/false in equations, and have not tried any of
them yet. (particular version my application the only choice left)

sorry if I left anything out I could have included, thought of the
following, but it may not matter? long-legs includes tests of same item from
mulitple locations, placed in a conditional format (for which this question
surrounds). For items that I "have" to test, the space required of 257/258
characters was a constraint. Thanks.



"bpeltzer" wrote:

=and(a=c,if($ab2="x",b=c,true)).


"nastech" wrote:

don't know it this can work, but
i have working, long equations that break down into basically 3parts:
If switch is set, then a & b, else just a. That is a repetition I am trying
to get rid of.

basically have: =IF($ab$2="x",AND(A=C,B=C),A=C)

trying to get rid of using a=c twice, thanks..
(a can stand alone, but b must be anded with a)
maybe something like:
=AND(A=C,IF($ab$2="x",b=c)) but 2nd part comes up as false, so not work..
=AND(A=C,IF($ab$2<"x","",b=c)



nastech

smaller equations: a & b, or just a..
 
060129: smaller equations: a & b, or just a..
Thanks-all ! ! These answers all look good, and should all be right, as was
wondering about use of true/false in equations, and have not tried any of
them yet. (particular version my application the only choice left)

sorry if I left anything out I could have included, thought of the
following, but it may not matter? long-legs includes tests of same item from
mulitple locations, placed in a conditional format (for which this question
surrounds). For items that I "have" to test, the space required of 257/258
characters was a constraint. Thanks.


"Dana DeLouis" wrote:

trying to get rid of using a=c twice


I think if you factor out a=c, it reduces to this:

=AND(a=c,OR(b=c, $ab$2<"x") )

Hope I got it right :)
--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"nastech" wrote in message
...
don't know it this can work, but
i have working, long equations that break down into basically 3parts:
If switch is set, then a & b, else just a. That is a repetition I am
trying
to get rid of.

basically have: =IF($ab$2="x",AND(A=C,B=C),A=C)

trying to get rid of using a=c twice, thanks..
(a can stand alone, but b must be anded with a)
maybe something like:
=AND(A=C,IF($ab$2="x",b=c)) but 2nd part comes up as false, so not work..
=AND(A=C,IF($ab$2<"x","",b=c)






nastech

smaller equations: a & b, or just a..
 
060129: smaller equations: a & b, or just a..
Thanks-all ! ! These answers all look good, and should all be right, as was
wondering about use of true/false in equations, and have not tried any of
them yet. (particular version my application the only choice left)

sorry if I left anything out I could have included, thought of the
following, but it may not matter? long-legs includes tests of same item from
mulitple locations, placed in a conditional format (for which this question
surrounds). For items that I "have" to test, the space required of 257/258
characters was a constraint. Thanks.


" wrote:

"nastech" wrote:
i have working, long equations [...].
basically have: =IF($ab$2="x",AND(A=C,B=C),A=C)
trying to get rid of using a=c twice


You do not explain why. If you merely want to avoid typing,
any of the methods suggested so far will suffice. But you
might also want consider the cost of evaluating formulas
unnecessarily, if they are "long equations" or invoke costly
functions. To minimize that, I believe you want to stick with
the IF() form, but change the order of testing.

=if(A=C, or(B=C, $ab$2<"x"), false)

When A=C is false, that avoids evaluating B=C while also
reducing typing. Even more efficient:

=if(A=C, if($ab$2<"x", true, B=C), false)

The point is: AND() and OR() functions evaluate all
parameters, whereas IF() evaluates only the appropriate
true-part or false-part depending on the value of the
conditional expression. Arguably, usually it is not a big deal.



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

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