Display multiple results using an Nested if statement - excel

Display multiple results using an Nested if statement.
Is there a way to display multiple results from a nested if statement? or how do i change it to do so.
I am currently using:
=IF(H3="Yes",D3,IF(AD3="Yes",E3,IF(AZ3="Yes",F3,"None")))
If more than one is yes I would like to display both results.
Would I need to create a long IF(AND( statement including all of the possible outcomes or does someone know a quicker way ??

The order in your formula is incorrect.
First you need to check all the ANDs and then you can check for the single occurrences. So, your formula should start with
=if(AND(H3="Y‌​es";AD3="Yes";AZ3="Yes");D3&E3&F3);if(and(H3="Y‌​es";AD3="Yes");D3&E3...
and towards the end of your formula you are adding the single checks
if(H3="Yes",D3,if(AD3="Yes",E3,...

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

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 search for multiple items

I am trying to search for multiple items in a cell. If any of the terms I am looking for is present, I want cell D to display "Laptop", otherwise, display "Desktop". I can get the following to work, with just one term to search for:
=IFERROR(IF(SEARCH("blah",A2),"Laptop",""),"Desktop")
But I want to search for the presence of blah, blah2, and blah3. I don't know how to get Excel to search for any of the following terms. (Not all of them mind you, just any of the following.
I did see that there is an or option for the logic.
=OR(first condition, second condition, …, etc.)
I am not sure how to get these two to work together. Any thoughts on how to get them to display "Laptop" if any of the words are present?
This should work:
=IF(SUM(COUNTIF(A2,"*" &{"blah1";"blah2";"blah3"}& "*"))>0,"laptop","desktop")
You could use the combination of OR, IFERROR and SEARCH as you suggest, but I think the simpler construct would be ...
=IF(AND(ISERROR(SEARCH("value1",A2)),ISERROR(SEARCH("value2",A2))),"Desktop","Laptop")

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