ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Formula with 3 conditions (https://www.excelbanter.com/excel-discussion-misc-queries/183903-formula-3-conditions.html)

txm49

Formula with 3 conditions
 
Need a formula whereby three conditions are met to return a result.
For example, If A10 and A20 and A30, then F1+F2. If A1<0 and A20 and
A30, then F1+F3, etc.

nathan_savidge

Formula with 3 conditions
 
=if(and(a10,a20,a30),f1+f2,if(and(a1<0,a20),f1 +f3))

Somthing like that, havent tested it. Just saw your post while looking for
my own answer.

"txm49" wrote:

Need a formula whereby three conditions are met to return a result.
For example, If A10 and A20 and A30, then F1+F2. If A1<0 and A20 and
A30, then F1+F3, etc.


Pete_UK

Formula with 3 conditions
 
Not sure what you mean by "etc." - do you have many other conditions?
With 3 binary variables you could have up to 8 different combinations,
and more if A1=0 is a third state that you want to check for.

Anyway, the first part of your problem can be achieved like this:

=IF(AND(A10,A20,A30),F1+F2,IF(AND(A1<0,A20,A3 0),F1+F3,"etc"))

Hope this helps.

Pete

On Apr 16, 12:33*pm, txm49 wrote:
Need a formula whereby three conditions are met to return a result.
For example, If A10 and A20 and A30, then F1+F2. *If A1<0 and A20 and
A30, then F1+F3, etc.



Mike H

Formula with 3 conditions
 
There are a lot of potential combinations here, can you define and quantify
etc?

Mike

"txm49" wrote:

Need a formula whereby three conditions are met to return a result.
For example, If A10 and A20 and A30, then F1+F2. If A1<0 and A20 and
A30, then F1+F3, etc.


MyVeryOwnSelf

Formula with 3 conditions
 
Need a formula whereby three conditions are met to return a result.
For example, If A10 and A20 and A30, then F1+F2. If A1<0 and A20
and A30, then F1+F3, etc.


There are 8 possibilities, if my understanding of the problem is correect.

One approach is to start with the formula below. It returns a text string
for each of the possibilities, showing which ones of the three input values
are positive.

=CHOOSE((N(A1)0)+2*(N(A2)0)+4*(N(A3)0)+1,
"none","A1","A2","A1&A2","A3","A1&A3","A2&A3","all ")

For your problem, you would replace each of the text strings with the
corresponding formula.

In this formula, input cells containing text are considered "not 0";
likewise for empty cells and logical FALSE. Dates are considered "0";
likewise for logical TRUE. If that's not what's required, adjust
accordingly.

Also, the requirements seem vague for when input value(s) are exactly zero,
so adjust the formula based on what's wanted in those cases.


All times are GMT +1. The time now is 09:11 AM.

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