I can not figure out how to put 2 of the same IF statement but with a different result in case is not there then to do the second combination.
=IF(C2737="XXX_SF",INDEX(TMParking_8_24!A:A,MATCH(Tracker!J2737&"xxxshortform",TMParking_8_24!F:F,0)),
The above formula is what I'm looking for. Incase xxxshrotform is not there I would like it to search for a xx5shortform. So I added the below to the second part of the formula:
INDEX(TMParking_8_24!A:A,MATCH(Tracker!J2737&"xx5shortform",TMParking_8_24!F:F,0)))
Within the INDEX the xx5shortform exists but it is not finding it.
Use the IFERROR function to pass control over to a second MATCH function if the first is not found.
=IF(C2737="XXX_SF",
INDEX(TMParking_8_24!A:A,
IFERROR(MATCH(Tracker!J2737&"xxxshortform",TMParking_8_24!F:F,0),
MATCH(Tracker!J2737&"xxshortform",TMParking_8_24!F:F,0))), "")
There was no indication as to what to return if C2737 does not equal XXX_SF nor what to do if the second match does not work.
Related
Okay so my question is how do i use IF with 3 arguments while one of the arguments is "Ignore blanks".
If A1 is "Escalation_complaint or "Escalation_request" B1 must show "Escalated".
If A1 is any other text, B1 must show "Solved"
If A1 is blank, B1 must remain empty.
Can someone please help me figure this out?
Your first test must be whether the A1 is empty or not. This must be the first because if you test whether an empty string is contained in another string the answer is always yes. =SEARCH("","Something") returns 1. So, How do you test for an empty cell? I recommend Excel's COUNTA() function but you may prefer testing for "". So, let's say, your first test is this.
=IF(COUNTA(A1), True, False)
Some would say IF(COUNTA(A1)>0, True, False) and that is equivalent. The simple IF(COUNTA(A1) tests for non-zero. Any number other than zero returns True.
So, now you got your basic function. What's supposed to happen if the result is True? What do you want to happen if the result is False? The latter is easy. If the result is False you want a null string returns. So, now your formula looks like this:-
=IF(COUNTA(A1), True, "")
Observe that we simply replaced the False with the desired output. So, what do you want to happen if A1 has something in it, if the first test resulted in True? There are two possibilities. That makes the problem solvable with a single IF. IF A1 has something starting with "Escalation" in it the result should be "escalate", else it should be "solved". So, how do you test for cell content?
=Find("escalation", A1) will not find "Escalation" (with a capital E). Therefore I recommend SEARCH(), which does.
=SEARCH("escalation", A1) should return 1. If it returns 1 your problem is solved because if it returns any other number its not "escalated" but "solved". Unfortunately, there is a third option. It might return an error. In fact it will return an error every time the word isn't found. That gives you a 3-way possibility (1, bigger than 1, or Error) which can't be solved with a single IF. So, I suggest to avoid the error.
=Find("escalation", A1 & "escalation") will find the word "escalation" every time. But it will find it in first position only if the conditions for "Escalate" is met. Therefore the formula for the True condition in the basic formula must be this:-
IF(SEARCH("escalation", A1 & "escalation") = 1, "Escalated", "Solved")
That's it. Assemble the second IF into the first and you're done.
So, using two if(), and minimising the testing you need :
=IF(left(A1,3)="Esc","Escalated",IF(A1="","","Solved"))
Edit: Based on a comment to another answer, if testing for "esc" only could lead to problems then how about:
=IF(left(A1,5)="Escal","Escalated",IF(A1="","","Solved"))
Which will avoid words like "escaped" or "escargot"...
If you know that the text will always be Escalation_complaint or Escalation_request, you can do this with a nested IF query. =IF in Excel takes three parameters: what to verify, result if true, and result if false. You can have another IF statement in the what to do if it returns false section. We can also do an OR() statement to verify both Escalation_complaint and Escalation_request. The result looks like this:
=IF(OR(A1="Escalation_complaint",A1="Escalation_request"),"Escalated",IF(A1="","","Solved"))
The order here is important because you want the "for all other cases" to be in the final IF statement.
If you have a situation where you could also have "Request_escalation" or "complaint_escalation", you should make a more general solution that uses SEARCH or FIND which would allow you to do a more general lookup that allows for more values without having to hardcode them. Here is an example that makes it possible to find the word Escalation anywhere in the cell:
=IF(IFERROR(SEARCH("escalation",A1,1),0)>0, "Escalated", IF(A1="","","Solved"))
Excel have maximum 30 arguments in a formula.
= if (A1=1, "True",if(B1>2,"True", "false"))
Understand this pattern. easy way.
If you no longer understand this, or if your problem has not been resolved, attach a file or screenshot that relates to your problem.
I need a function to look up organizational abbreviations in a text and return the first one thas shows up. I tried to solve that with a nested if clause but it has a logical error.
=IF(ISNUMBER(SEARCH("BZC";I5)); "Finanz"; IF(ISNUMBER(SEARCH("AZC" /1";I5));"IT";""))
It looks up BZC and AZC as desired and return the organization name. However, it does no return the first match in a string. Since BZC is the first lookup it will always be returned if it is in the string, eventhoug it might not be the first org abbreviation.
What functionality of excel can be used to solve this issue? I basically need an array of variables that a function should do a look up and return the first one that is found.
Edit:
I tried to implement the formula form Justyna MK. Besides the fact, that I still need to figure out the meaning of the formula (iferror, mid, small) It returns #N/A in my example. Is there a certain reason for that?
I hope I understood your request correctly. Here's an Array formula for you to try (enter using Ctrl + Shift + Enter):
=CHOOSE(MATCH(MID(A1,SMALL(IFERROR(SEARCH({"BZC","AZD","xxx"},A1),""),1),3),{"BZC","AZD","xxx"},0),"Finanz","IT","Other")
You'd probably need to change , to ; in order to match your regional settings.
You can easily expand the list of search items by modifying the contents of curly brackets { } and also by expanding the MATCH results at the very end of the formula.
Here's some sample result:
Edit: here's an adjusted solution that ignores the length of your code (the previous solution was assuming that the code is always 3-characters long). This time it's not an array formula so you can enter it as it is.
Also, I suspect that you should not change , to ; inside the curly brackets (it would modify the formula from column to row delimiter and thus it will stop working). The remaining , can be transformed to ;, if that makes sense.
=CHOOSE(MATCH(TRIM(LEFT(SUBSTITUTE(RIGHT(A1,LEN(A1)-SUMPRODUCT(SMALL(IFERROR(SEARCH({"BZC","AZD","XYZX/1","NP-HSD"},A1),""),1))+1)," ",REPT(" ",255)),255)),{"BZC","AZD","XYZX/1","NP-HSD"},0),"Finanz","IT","Other1","Other2")
The result:
I have this string to match some text using VLOOKUP.
=CONCATENATE(VLOOKUP(D10,Clients!A1:F10034,2),", ",VLOOKUP(D10,Clients!A1:F30034,3),", ",VLOOKUP(D10,Clients!A1:F10034,4),", ",VLOOKUP(D10,Clients!A1:F10034,5))
When it runs into a match that has a full stop in it, the match returns the first result that matches what it has before the full stop.
Eg if the lookup tries to match "C.B.A Solutions" and there is "C Tyres" & "C.B.A Solutions" inside of "Clients!" it will match "C Tyres" because it comes up first.
Your VLOOKUPS are missing the 'optional' forth argument. Note that this forth argument isn't 'optional' unless your data is sorted in ascending order and a match is guaranteed (i.e. your lookup term will always exist in the lookup database). Is that the case here? If so, amend your question to clarify. If not, add 'False' in as a forth argument.
Note that your formula is very inefficient. Most of the work that VLOOKUP does is in locating a matching row in the key column where the lookup term is. Better to relegate that computationally expensive task to a dedicated MATCH function in its own column, and then to feed that result to four INDEX functions.
Put this in a separate column:
=MATCH(D10,Clients!A1:F10034,0)
Then point some INDEX functions at the answer, instead of using computationally expensive VLOOKUP functions:
=CONCATENATE(INDEX(Clients!C1:C30034,[Match Output]),", ",INDEX(Clients!D1:D30034,[Match Output]),,", ",INDEX(Clients!E1:E30034,[Match Output]),)
Replace [Match Output] with the cell containing the output of the MATCH function.
Google INDEX and MATCH vs VLOOKUP for why this matters.
Note that sorting your lookup lists and then ommittig that forth argument and using something called the Double VLOOKUP trick (that handles missing values in your lookup list) will be many thousands of times faster again. See my post at the following link for more:
http://dailydoseofexcel.com/archives/2015/04/23/how-much-faster-is-the-double-vlookup-trick/
Essentially, I am looking for a way to use the "search" function like the "vlookup" function. In my case, I am have a long list, of say, 1000 descriptions of different types of fasteners and I want to classify them according to what they are, (ie. Nut, bolt, washer etc.). However, I can't sort by description or partnumber because they, alphanumerically, don't line up by class. But he descripotion field does say at some point in it, what it is(ie. Nut, bolt, washer etc.).
As said, I have a table of classes, and I am looking for a formula that would look in the "description" field for all the values in the table,and then return that value, or one associated with it (like vlookup does with cell values).
So that, if it found "nut" in the description, it would return "nut", or if it found "bolt" it would return "bolt."
I hope that this question makes sense. Let me also say that I found a way "manually" do this using the search function, along with others, but the formula was very long and each value in my table had to be specially called out. However, I will include the formula I used to make clear what I was trying to do.
See below.
=IF(ISNUMBER(SEARCH($G$2,C3)),$G$2,IF(ISNUMBER(SEARCH($G$3,C3)),$G$3,IF(ISNUMBER(SEARCH($G$4,C3)),$G$4,IF(ISNUMBER(SEARCH($G$5,C3)),$G$5,...IF(ISNUMBER(SEARCH($G$13,C3)),$G$13,"MISC"))))))))))))
You see that with each item you add to your table, you have to add another if loop. I am hoping there is a better way. (I would call it "vsearch" :-) )
Try this formula
=IFERROR(LOOKUP(2^15,SEARCH($G$3:$G$13,C3),$G$3:$G$13),"MISC")
SEARCH returns an array of numbers or errors depending on whether each term is found in C3. By searching for "bignum" (in this case 2^15) which won't be found, the match is always with the last number, i.e. the last matching term in G3:G13.
MATCH can be used to find the text, and INDEX can be used to return the text
using your example, where you are searching in G:
=MATCH("*"&C3&"*",$G:$G,0)
and then index to return the text
=INDEX($G:$G,MATCH("*"&C3&"*",$G:$G,0))
and as a finishing touch, the #VALUE! replacement
=IFERROR(INDEX($G:$G,MATCH("*"&C3&"*",$G:$G,0)),"MISC")
(I understand Excel is only borderline programming)
I have a block of data that represents the steps in a process and the possible errors:
ProcessStep Status
FeesPaid OK
FormRecvd OK
RoleAssigned OK
CheckedIn Not Checked In.
ReadyToStart Not Ready for Start
I want to find the first Status that is not "OK".
I have attempted this:
=Match("<>""OK""", StatusRange, 0)
which is supposed to return the index of the first element in the range that is NOT-EQUAL (<>) to "OK"
But this doesn't work, instead returning #N/A.
I expect it to return 4 (index #4, in a 1-based index, representing that CheckedIn is the first non-OK element)
Any ideas how to do this?
I think this and other similar questions are completely legitimate programming questions (EDIT: see here: https://meta.stackexchange.com/questions/22922/which-site-do-excel-or-other-spreadsheet-formulas-belong-on/76767#76767). (It's probably a duplicate of some other StackOverflow question, though.)
You want to use an array formula:
=MATCH(TRUE,(StatusRange<>"OK"),0)
You need to enter this as an array formula, with Ctrl-Shift-Enter.
'MATCH' finds a value in a range or an array. Comparing a range to a scalar, as in '(StatusRange<>"OK")', returns an array of boolean values, so you're looking to match a value of 'TRUE'.
(The formula you posted was looking for a string literal with the value '<>"OK"'...)
If you ultimately want the value in the ProcessStep column, look at the help for the 'INDEX' or 'VLOOKUP' functions.