Combining formulas using AND - excel

I am trying to combine two forumlas into one.
They both work individually and I would like to make it so the condition is only met if both formulas are met. The forumlas are:
=IF(AND(Sheet2!$C$6>40,Sheet2!$C$6<=50),TRUE,FALSE)
=IF((INDIRECT(SUBSTITUTE(ADDRESS(1,COLUMN(),4),"1","3"))>=Sheet2!$B$6),TRUE,FALSE)
I have tried to use another AND clause but had no luck yet with this, would anyone be able to provide a consolidated formula for both of these?

the long way:
=IF(AND(Sheet2!$C$6>40,Sheet2!$C$6<=50,INDIRECT("R3C"&COLUMN(),)>=Sheet2!$B$6), TRUE, FALSE)
the short way:
=AND(Sheet2!$C$6>40,Sheet2!$C$6<=50,INDIRECT("R3C"&COLUMN(),)>=Sheet2!$B$6)
also possible:
=((Sheet2!$C$6>40)*(Sheet2!$C$6<=50)*(INDIRECT("R3C"&COLUMN(),)>=Sheet2!$B$6))=1
why the SUBSTITUTE(ADDRESS(1,COLUMN(),4),"1","3")??? just ADDRESS(3,COLUMN(),4) will be the same... also why address at all? justINDIRECT("R3C"&COLUMN(),) will also work

Compiling the comments, this should be the minimal formula gathering your tests :
=AND(Sheet2!$C$6>40,Sheet2!$C$6<=50,INDIRECT(SUBSTITUTE(ADDRESS(1,COLUMN(),4),"1","3"))>=Sheet2!$B$6)

Related

In Excel how can I use IF Function with more then 70 conditions or is there any other way to do that

I'm trying to add if function with more then 70+ conditions. How can I do that or is there any other way to do that? I'm sharing screenshot.
Please help.
You have the tendency to nest IF-clauses enormously. I would advise you to write the whole idea down and try to simplify it, as you can see from following example:
I have three cells ("F2", "G2" and "H2"), all can have two values ("Work" or "Home"), and I have created two formulas to calculate a result:
Formula1 : =IF(F2="Home","Home",IF(F3="Home","Home",IF(F4="Home","Home","Work")))
Formula2 : =IF(AND(F2="Work",F3="Work",F4="Work"),"Work","Home")
You see: "Formula1" is based on three nested IF-clauses, while "Formula2" only one.
Yet, both formulas yield the same result!

Excel functions (IF / AND, etc)

Hey guys, so I need to follow the instructions on the left side of the screen and implement them into the 'Total' column on the right. (From the 'Total sales' column)
As you can see I've put an IF statement there just to test and it's very broken as I'm unsure how to begin.
I need some sort of long IF statement that incorporates those rules.
EG:=IF (E3 >= 3000 AND <= 4999.99, print(E3 *1.25), IF etc etc more rules here.
However it's very wrong and I'm sure its impossible to stack IF statements like that.
The method is not to stack the conditional statements, but to nest them!
An if statement is built in the following format:
=IF(CONDITION, RESULT-IF-TRUE, RESULT-IF-FALSE)
If you were to put another if statement if the first case is false, you could achieve your goal.
For example:
=IF(SALES<3000, BONUS=0, IF(SALES>=3000 AND SALES<5000, BONUS=0.025, IF(...)))
This is a Lookup task.
Since you seem to want to embed the targets and %'s in the formula, you could do if like this
=E3*INDEX({0;0.025;0.075;0.1},MATCH(E3,{0;3000;5000;8000},1))
or if you have a version of Excel that supprts XLookup
=E3*XLOOKUP(E3,{0;3000;5000;8000},{0;0.025;0.075;0.1},,-1,1)
More typically, you'd put the Targets and %'s in a range and lookup into that range

Excel IF(OR) - two OR's formula works but three doesn't?

I can get a two possibility formula to work but not a three. I thought it would just be adding a comma for another term then adding a comma for a value. Please can anyone tell me why its not working?
Working one:
=IF(OR(C6="buy", C6="hold"),(F5*(D6+1)),(E5*(D6+1)))
Not Working:
=IF(OR(C6="buy", C6="hold", c6="sell"),(F5*(D6+1)),(E5*(D6+1)),0)
After reading your problem description couple of times over I think you need below formula:
=CHOOSE(MATCH(C6,{"buy","hold","sell"},0),(F5*(D6+1)),(E5*(D6+1)),0)
In your second formula you have two parts (E5*(D6+1)) and 0 for the Value is False section, this version will work: =IF(OR(C6="buy", C6="hold", C6="sell"),(F5*(D6+1)),(E5*(D6+1)))

case statement in a spreadsheet

So,
what i am trying to accomplish here is pretty straight forward, i have a column fare in my spreadsheet and i want to add anew column that would say if the fare is <10 ,10<20,20<30,30+
I came up with this solution but it seems like it is not using a shortcut condition, is there a case statement or any other method i can use to achieve what i want?
=if(J19<10,"<10",IF(AND(J19>10,J19<20),"10<20",IF(AND(J19>20,J19<30),"20<30","30+"
)))
Try something like this:
=ROUNDDOWN(A1,-1)&"<"&ROUNDUP(A1,-1)
Since the conditions in a nested set of if functions are evaluated consecutively, you do not need to repeat previous conditions using and. Also note that your original formula doesn't do the right thing at the borderlines, e.g. if J19=10.
So although Excel does not have a case function, the following is simpler and more accurate than your original:
=if(J19<10,"<10",IF(J19<20,"10<20",IF(J19<30,"20<30","30+")))

Combining two IF condition in excel for a cell

I need help in combining two IF condition statements in excel. Both are working fine, just that when I try to combine them then I'm getting error. Below are the conditions:
=IF(AND(F19="No", NOT(OR(ISBLANK(B36),ISBLANK(B37),ISBLANK(D36),ISBLANK(D37),ISBLANK(B40),ISBLANK(D39),ISBLANK(F39),ISBLANK(D40),ISBLANK(F40),ISBLANK(B43),ISBLANK(B44),ISBLANK(B48),ISBLANK(B49),ISBLANK(B50),ISBLANK(B51),ISBLANK(B52)))),"Section Complete","Section Incomplete")
=IF(AND(F19="Yes", NOT(OR(ISBLANK(B36),ISBLANK(B37),ISBLANK(D36),ISBLANK(D37),ISBLANK(B40),ISBLANK(D39),ISBLANK(F39),ISBLANK(D40),ISBLANK(F40),ISBLANK(B43),ISBLANK(B44),ISBLANK(B48),ISBLANK(B49),ISBLANK(B50),ISBLANK(B51),ISBLANK(B52),ISBLANK(D43),ISBLANK(D44),ISBLANK(D45),ISBLANK(D46),ISBLANK(D47),ISBLANK(D48),))),"Section Complete","Section Incomplete")
Please help me in combining them.
Thanks in advance, Krishna
... I didn't try and make it prettier / more efficient - I just used your original formulas, but this should do what you want:
=IF(OR(AND(F19="No", NOT(OR(ISBLANK(B36),ISBLANK(B37),ISBLANK(D36),ISBLANK(D37),ISBLANK(B40),ISBLANK(D39),ISBLANK(F39),ISBLANK(D40),ISBLANK(F40),ISBLANK(B43),ISBLANK(B44),ISBLANK(B48),ISBLANK(B49),ISBLANK(B50),ISBLANK(B51),ISBLANK(B52)))),AND(F19="Yes", NOT(OR(ISBLANK(B36),ISBLANK(B37),ISBLANK(D36),ISBLANK(D37),ISBLANK(B40),ISBLANK(D39),ISBLANK(F39),ISBLANK(D40),ISBLANK(F40),ISBLANK(B43),ISBLANK(B44),ISBLANK(B48),ISBLANK(B49),ISBLANK(B50),ISBLANK(B51),ISBLANK(B52),ISBLANK(D43),ISBLANK(D44),ISBLANK(D45),ISBLANK(D46),ISBLANK(D47),ISBLANK(D48))))),"Section Complete","Section Incomplete")
Hope this does the trick!!
You could just as simple replace the "Section incomplete" in the first No-IF, by replacing it with the Yes-IF.
=IF(AND(F19="No";NOT(OR(ISBLANK(B36);ISBLANK(B37);ISBLANK(D36);ISBLANK(D37);ISBLANK(B40);ISBLANK(D39);ISBLANK(F39);ISBLANK(D40);ISBLANK(F40);ISBLANK(B43);ISBLANK(B44);ISBLANK(B48);ISBLANK(B49);ISBLANK(B50);ISBLANK(B51);ISBLANK(B52))));"Section Complete";IF(AND(F19="Yes";NOT(OR(ISBLANK(B36);ISBLANK(B37);ISBLANK(D36);ISBLANK(D37);ISBLANK(B40);ISBLANK(D39);ISBLANK(F39);ISBLANK(D40);ISBLANK(F40);ISBLANK(B43);ISBLANK(B44);ISBLANK(B48);ISBLANK(B49);ISBLANK(B50);ISBLANK(B51);ISBLANK(B52);ISBLANK(D43);ISBLANK(D44);ISBLANK(D45);ISBLANK(D46);ISBLANK(D47);ISBLANK(D48);)));"Section Complete";"Section Incomplete"))
Try simplifying with some COUNTA functions like this:
=IF(AND(COUNTA(B36,B37,D36,D37,B40,D39,F39,D40,F40,B43,B44,B48:B52)=16,OR(F19="No",AND(F19="Yes",COUNTA(D43:D48)=6))),"Section Complete","Section Incomplete")
That should combine the two formulas without repetition

Resources