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+")))
Related
I don't know if you consider that excel is a valid programming language to ask in there, but I need this for a project.
In the switch() function, I said to compare the max value of those cells to return the one that coincides, but when two values are the same, it returns the one who is first.
=SWITCH(MAX(J3:J7);J3;"Jugador 1";J4;"Jugador 2";J5;"Jugador 3";J6;"Jugador 4";J7;"Jugador 5")
How could I make it to return "Jugador 2, Jugador 3" instead of just one of them?
I don't figure what function can do something like that. I thought of making something like to functions in one but don't know.
Welcome!
There are several different techniques to accomplish this task. One of them is using a combination of TEXTJOIN() and IF() functions in array formula:
{=TEXTJOIN(",";1;IF(J3:J7=MAX(J3:J7);A3:A7;""))}
=IF(AND(F2=N2;G2>O2);"No Notificar";"Notificar";IF(AND(F2=N3;G2>O3);"No Notificar";"Notificar";IF(AND(F2=N4;G2>O4);"No Notificar";"Notificar";IF(AND(F2=N5;G2>O5);"No Notificar";"Notificar";IF(AND(F2=N6;G2>O6);"No Notificar";"Notificar";IF(AND(F2=N7;G2>O7);"No Notificar";"Notificar")))))
As #KromeWing said - you've entered too many parameters for an IF formula.
It should have a logical calculation that would return TRUE/FALSE and then what to do if it's TRUE and what to do if it's FALSE.
Currently your formula reads as:
=IF(AND(F2=N2,G2>O2),"No Notificar","Notificar",
IF(AND(F2=N3,G2>O3),"No Notificar","Notificar",
IF(AND(F2=N4,G2>O4),"No Notificar","Notificar",
IF(AND(F2=N5,G2>O5),"No Notificar","Notificar",
IF(AND(F2=N6,G2>O6),"No Notificar","Notificar",
IF(AND(F2=N7,G2>O7),"No Notificar","Notificar")))))
It should look more like:
=IF(AND(F2=N2,G2>O2),"No Notificar",
IF(AND(F2=N3,G2>O3),"No Notificar",
IF(AND(F2=N4,G2>O4),"No Notificar",
IF(AND(F2=N5,G2>O5),"No Notificar",
IF(AND(F2=N6,G2>O6),"No Notificar",
IF(AND(F2=N7,G2>O7),"No Notificar","Notificar"))))))
So if the first equation is TRUE it will show No Notificar, otherwise it will test the second equation. If all equations return FALSE then it will return Notificar.
IF has only 3 parameters.
Your consecutive IF should be the 3rd parameter, there is no 4th parameter in this formula.
You are expecting IF() to accept four arguments instead of three.
I often get messed up by nested ifs, too, and it's usually from having to think too hard.
To make things easier on yourself, both today and next month when you come back to this and have to try to figure out what the heck you were trying to do, try using alt-enter to add a new line within your formula, allowing you to format your formula like this:
=IF(test, valueIfTest,
IF(test2, valueIfTest2,
IF(test3, valueIfTest3,
...
valueIfAllTestsFail
)))
I find that as long as I stick to this format, the hardest part of the syntax is reduced to having the right number of closing parentheses at the end, but thanks to how Excel color-codes matching parentheses, I can manage that even when I'm caffeine-deprived!
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
Say I have multiple tasks: quoting, binding, rating that have same response time of 3 hours... I was wondering if there was a way to make an IF statement such that I could just say for example:
=IF(B2="*Quoting,Binding,Rating", C2+3, NA)
I haven't been able to get it to work, and I'm trying to avoid using an OR statement with the IF statement to get the values, but is it possible to do it this way? It sounds simple, "If it's task x,y,z then add 3 hours to the start time column (C2)". Any advice guys? Thanks!
This may achieve what you're after
=IF(NOT(ISERROR(SEARCH(B2,"Quoting,Binding,Rating"))), C2+3, "NA")
Hope that helps
Use the OR statement: =(IF(OR(B2="Quoting",B2="Binding",B2="Rating"),C3+3,NA()))
If you're looking to shorten the formula, you can put the values you want to check into a named range (I used "List" to reference "I:I" but you could put the list on another sheet) and use SUMPRODUCT.
=IF(SUMPRODUCT(--(B2=List))>0,C3+3,NA())
I have the formula below that has two IF Statements however it is given an error. Any help is appreciated.
=IF((AND(B11>65,D15>65)),Sheet!D$47,VLOOKUP(D15,Sheet!$A$2:$K$51,4,FALSE)),IF((AND(B11>61,D15>61)),Sheet!D$44,VLOOKUP(D15,Sheet!$A$2:$K$51,4,FALSE))
What I am trying to Achieve is the following:
IF B11>65 and D15 >65 Then select value from D$47. IF B11<65 and D15<65 Then Select value from D$44. Else VLOOKUP(D15,Sheet!$A$2:$K$51,4,FALSE))
You can have multiple IF() calls embedded such as this:
=IF(AND(), Sheet!D$47, IF(AND(), Sheet!D$44, VLOOKUP())
The complete form in your case would be:
=IF(AND(B11>65,D15>65), Sheet!D$47, IF(AND(B11>61,D15>61), Sheet!D$44, VLOOKUP(D15,Sheet!$A$2:$K$51,4,FALSE)))
Basically, this uses the 'Else' clause as a means to add additional clauses. It is possible to do it the other way around but I personally find that harder to read.