Excel functions (IF / AND, etc) - excel

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

Related

How to find first unique value in a column of SKU?

So I have two columns, A & B, (like below). There's 2 components to the ID, the design (CEN101A) and the size (-6).
I'm trying find the first item of each design. So in this example, I would highlight (CEN106A-6, CEN101B-6, CEN101D-6, etc.). This is so I can use them as a parent for the other sizes.
I've tried many in-built functions but nothing seems to work. Is VBA able to easily find these values?
#BigBen is right, this is fairly easy if you can find what the actual design code is. For good measure I'd use a running count and add the hyphen back including a wildcard into the COUNTIF():
Formula for conditional formatting rule on range A2:A7:
=COUNTIF(A$2:A2,#TEXTSPLIT(A2,"-")&"-*")=1
Without TEXTSPLIT(), use a combo of LEFT() and FIND() as per the comment by #P.b:
=COUNTIF(A$2:A2,LEFT(A2,FIND("-",A2))&"*")=1

Excel percentage increase based on formula

I am trying to fill the sell price column in an Excel spreadsheet with the increased values in colors based on the round up columns value (1 to 50 green, 50 to 100 blue, 100 to 150 yellow, 150+ pink).
I've opted for the percentage table because some items can be sold for a lot more than what I have purchased them for, so that's just for my benefit. I am open to any other suggestions and I am new to this whole business thing.
I was using IF in my formula which would work great for using one percentage increase in the formula:
=IF($E27<50,ROUNDUP(I$27,-1))
If I try to enter a second argument like
=IF(OR($E28<50,ROUNDUP(I$28,-1)OR($E28>50,<100,ROUNDUP(J$28,-1))))
I will get an error.
I'm probably using the formulas wrong, I've tried "AND" and a couple other formulas, but I can't find anyone else trying to achieve the same or similar.
So something like this:
=IF($E28<50,ROUNDUP(I$28,-1),IF($E28>50,ROUNDUP(J$28,-1),"Error"))
But not sure what the <100 was for.
Although the problem is not completely clear, I understand that you want to add a formula with nested if statements.
I will recommend you to try nested ifs in parts.
=IF($E27<50,ROUNDUP(I$27,-1),"First if condition is false")
If everything is working as per the requirement then edit that text in the formula to add another if statement.
=IF($E27<50,ROUNDUP(I$27,-1),IF(OR(condition 1, condition 2,more conditions),"value if true","value if false"))
In the second argument provided by you, the arguments of the OR function has not been properly provided. Ensure that all the arguments of an OR function are conditions separated by a comma.
$E28<50 This is a condition so it's ok.
But other arguments are not making sense.
Also, using OR multiple times inside the first OR arguments is not clear.
It would be beneficial if you could provide the basic table and mention the requirement clearly.

Looking at multiple values with one statement w/o OR statement

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())

How to include Multiple IFs in Excel formula?

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.

Excel Serial If statements

I'm new to Excel, and I'm struggling with a formula. Essentially, what I'm looking for is to filter a cell through a set of procedures using a formula (this part isn't strict).
For example
Let's say I have a cell, A1. I'm trying to perform different calculations on this based on whether it is between a certain range of values. The problem is, it can be within several ranges.
Pseudo-Code representation
If(A1 > 187.5) {
// Run some code here.
}
If(A1 > 150) {
// Run some code here.
}
NOTE : The above example is only to illustrate the logic of sequential if statements.
Note that I Do not want a nested If statement. I'm just trying to run the same value through various checks. How do I do this in an Excel formula?
The best I can come up with is something like the following.
=(A1>187.5)*<some expression>+(A1>150)*<some expression>+....
The result of this will be some single value. (The straightforward way to get multiple values is to have the individual terms in separate cell.
If you want the result to reflect one among several mutually exclusive outcomes, then you would want to go with:
=(A1>187.5)*<some expression>+(A1>150)*(A1<=187.5)*...etc.
There are many ways to achieve this. One way is to use nested conditions like this:
=IF(Something, do something, IF(something else, do something, do something))
This is good if you want to condensate the formula a bit but arguably leads to more cluttered formulas. According to the FAST-Standard organization, those cases of nested conditions should be replaced by the use of flags. The most simple case would be, for example, where you would be looking for a rebate percentage according to a sales amount. In multiple cells you would have IF conditions evaluating to true only if the value matches that specific range. Then, your formula can be as simple as a SUMPRODUCT of your flags with your rebates percentages.
This is one example, but it can be applied to other cases very well too.
if there is a relationship between the numbers your checking for its very likely you can use
=CHOOSE(FLOOR(A1/160,1)+1,"<160",">160")
Which would put your 150 in the first and leave your 185 in the second

Resources