How to select the matching template in Excel - excel

My data is as follows:
I need to find the index of the matching template. Now I am using the complicate finction:
=IF(COUNTIF(A2,D$2)>0,1,IF(COUNTIF(A2,D$3)>0,2,IF(COUNTIF(A2,D$4)>0,3,0)))
Is there any better way?
I know that I probably could just determine UDF with VBA which would iterate through the templates range but I would avoid it.
I can find the best cell based on the template with MATCH().
But I need the opposite direction.
And I know that I could probably use Fuzzy Lookup. But I would again avoid it.

Since we are numbering according to the values we are looking for in the cell, I could not see a solution other than the if command. Because we are looking for more than one template and moving forward.
It's not the solution you want, but it might be a different alternative.
=IF(IFERROR(FIND($D$2,A2),0)>0,1,IF(IFERROR(FIND($D$3,A2),0)>0,2," "))

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 2016: A nested if statement error is coming up with the correct # of parenthesis

IF(C5="","",IF(D5="",C5,IF(E5="",(SUM(C5:D5/2),IF(F5="",(SUM(C5:F5/3),IF(G5="",(SUM(C5:F5/4),IF(H5="",(SUM(C5:G5/5),IF(I5="",(SUM(C5:H5/6),IF(J5="",(SUM(C5:I5/7),IF(K5="",(SUM(C5:J5/8),IF(L5="",(SUM(C5:K5/9),(SUM(C5:L5/10))))))))))))))))))))
1.Trying to find an average based on number of trials(columns)
You probably want the AVERAGE() worksheet function.
=AVERAGE(C5:L5)
will give you an average of that range and automatically ignore blanks.
(Edited to reflect that the 7-level nesting limit has been expanded, but this solution is probably still the preferable way to go).
Something like following purely on the basis of the right number of parentheses? I have removed the ones around each SUM.
=IF(C5="","",IF(D5="",C5,IF(E5="",SUM(C5:D5/2),IF(F5="",SUM(C5:F5/3),IF(G5="",SUM(C5:F5/4),IF(H5="",SUM(C5:G5/5),IF(I5="",SUM(C5:H5/6),IF(J5="",SUM(C5:I5/7),IF(K5="",SUM(C5:J5/8),IF(L5="",SUM(C5:K5/9),SUM(C5:L5/10)))))))))))

Select filtering and applying quantity amount to listed percentages

I tried to search but didn't find anything that was exact to what I was looking for. Let's say that I have the Investment$$ and I want to allocate that amount to only Items = to Toy Story and where Character begins with TS. The Investment $$ should only be applied to "Toy Story" and where character begins with "TS".
Apologies on not being able to embed the pictorial example to this message.
I need to write this in VBA. My questions is, is the best way to do this through a vlookup (programmed via VBA)? I want to avoid having the $1000 applied to the wrong movie title and even when it is applied to the right one (Toy Story) I want to make sure it's applied to the right ("TS") ones.
I'll also experiment on my end as well.
Pixar Movie Example
No need for VBA here. You can go with a plain vanilla Excel formula.
What you need in this situation is a key/ID item for your VLOOKUP - how you make that key is up to you, but with it you can easily utilize VLOOKUP. See my below example:

Single Use List - Excel

I'm after a way of preferably using VLookup to return information and once returned, have the source information unavailable for the same lookup.
e.g. If I have a list of names I have not used in seating for an event, I will want a formula which can look up this information WITHOUT entering the same name more than once. I'd rather not do a drop-down option as requires selecting the entry and I want my whole table to be an self-filling database.
I've about 20 nested IF functions going on in one cell so ideally something that could fit in there easily? Ill take anything honestly :P
Thanks in advance

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

Resources