Excel Match multiple criteria - excel

Could someone help me turn this 2 Criteria match function into a 4 criteria match function please? This one works, but is only the start:
=INDEX(range1,MATCH(1,(A19=range2)*(B19=range3),0))
I also want a third and fourth match in the above formula, with those two being an OR option. I thought based upon the working version that this might work, but it doesn't:
=INDEX(range1,MATCH(1,(A19=range2)*(B19=range3)*(OR(C19=range4,D19=range5)),0))
I've been trying to use AND commands, my initial version of the first code above being this:
=INDEX(range1,MATCH(1,AND(A19=range2,B19=range3),0))
It always returns #N/A after CTRL+ALT+ENTER is entered though, so it's obviously an issue with my understanding of either MATCH or AND (or both I guess),
The first example works EXACTLY as intended, but unfortunately I don't know why and I can't work it out well enough to adapt it. Maybe I'm too tired and have run out of space in my head for the peculiar way in which Excel formulas work, but I've read and re-read the help files for them and still it doesn't make sense to me.
Any help would be greatly appreciated, as always.
Thanks,
Joe

I'm just guessing here, but would this work?
=INDEX(range1,MATCH(1,(A19=range2)*(B19=range3)*(((C19 = range4)+(D19 = range5))>0),0))

Related

How do I return a list with the five oldest dates?

So I have a list - see example:
I want a function to check the complete list (imagine there is more than 1 entry), and returns with f.i. the 5 oldest rows (sorted by data in row B). As in complete rows.
I can get the lowest through:
=MIN(C3:C29)
But that doesn't seem as something usable for this no matter how I do it.
Then I though I could use the INDEX/LARGE functions (or MATCH? Would that be possible?), but I'm too stupid to make it work atm.
Is this even the right way?
I can make a macro doing it (filtering, copying first lines etc - stupid) but I know there is a smarter way of doing it.
Can anyone help me on my way or tell me if I'm looking up the wrong functions for this? Please tell me if I need more details.
Thanks
So, try this:
Cells formatted as shortdate.
And it works with months as well:

Google sheets, how do I get regexmatch to find a text string in a list?

I am new here, I have tried search for this answer and I can't find the same question
I am a totally self taught spreadsheet-maker, so if I have done some weird stuff - Please don't judge too harshly!
So I am using REGEXMATCH, and it just doesn't seem to be working like it usually does, and I can't work out why.
=IF($A13="","",(IF(REGEXMATCH({$L$13:$L$18},$A13),"YES","NO")))
I have made a workbook example to show the dilemma-
https://docs.google.com/spreadsheets/d/1paNG9Q-AciYbIR3HSgW7vxqNJmJBexgpm2lkLn32PN8/edit?usp=sharing
I want each line to tell me if its CODE-ID is in a list of items. I am pretty sure I had this working at some point, but I can't remember what I have changed. The regexmatch seems to just be picking up whether the code is in the first cell of the list.
Can anyone tell me what I have done wrong? I want the YES/NO column to change as I add new CODE-IDs to the list.
The weird thing is, I have got other cells to work by breaking the code right down to the basic regexmatch formula and building it up again, but it wont replicate when I copy it to another line. I don't know how to show that in this example because it isn't working here.
Let me know if this makes sense,
Thank you kindly,
Ellie
use in I13:
=INDEX(IF(A13:A="",,IF(ISNUMBER(MATCH(A13:A, L13:L18, 0)), "YES", "NO")))
You can use this array formula. No need to drag down to each cell.
=ArrayFormula(ISNUMBER(MATCH(A13:A18,L13:L18,0)))

Basic IF Statement question -probably right in front of me

Sorry i know this is super basic but i didn't know where else to ask and i really feel like the answer is right in front of me...
I have a spreadsheet which im going to use to log PAT test results. When i select the test type from a drop down it changes the standards and thresholds in the bit below and will tell me if each test passes or fails. It uses several vlookups and relative references - so far no VBA. Looking at this photo. What I'm trying to do is get the formula in cell I13 to read the symbol in F13 and use that in the formula rather than typing the symbol directly into the formula as its going to change when i change the Class Type option.
So far ive gotten to this (has a blank IF to start with to keep it neat:
=IF(H13="","",IF((H13&F13&(VALUE(G13))),"PASS","FAIL"))
The bit in bold is where the issue is. When i run the evaluate formula it boils the bold bit down to "0.01>2" which is correct however it then wont read that in the larger IF statement - i think its the quotation marks. So i think it needs another function to allow the IF statement to read that as the logical test rather than a text string.
I've tried VALUE, FORMULATEXT, NUMBERTEXT, all the ones that might be close to what I'm trying to do but 100% stumped now. Always bring sup the #VALUE Error.
Appreciate any advice? TIA
There is no built-in function for that. You need either a VBA function or the old EVALUATE XLM function (which you can't use directly in a cell, it has to be in a defined name). Sample UDF:
Function EvaluateFormulaString(FormulaString as string)
EvaluateFormulaString = application.evaluate(formulastring)
End Function
then your formula would become:
=IF(H13="","",IF(EvaluateFormulaString(H13&F13&(VALUE(G13))),"PASS","FAIL"))

Excel 2016: Searching for multiple terms in a cell

I'm trying to do a search for multiple strings in a cell with an OR-condition in Excel 2016.
E.g. I have a string abcd1234 and I want to find ab OR 12.
I'm using the german version where the function SEARCH is called SUCHEN and it should behave the same way.
I found this answer which suggests this solution:
SEARCH({"Gingrich","Obama","Romney"},C1).
I also found this website which suggests the same syntax:
SEARCH({"red","blue","green"},B5)
Same with this website:
SEARCH({"mt","msa","county","unemployment","|nsa|"},[#Tags])
So they basically say make a list of search terms separated by commas enclosed by curly braces and you're good.
But putting these into Excel 2016 just results in the usual meaningless Excel error message which says there was an error with the formula and it's always highlighting the whole part in curly braces.
Taking the first example the only way I could get Excel to not throw its error message was to change the syntax like this:
=SEARCH({"Gingrich";"Obama";"Romney"};C1)
But separating the search terms with semicolons doesn't apply the OR-condition correctly, so this is not the solution.
I'm aware from this answer that I could make separate searches and string them together with a condition, but I would like to avoid that, and I also want to know why the syntax that is supposed to work as confirmed by multiple sources is not working for me.
EDIT:
Okay, I'm starting to understand this, thanks to Solar Mike:
The code =IF(COUNT(SEARCH({"Romney","Obama","Gingrich"},A1)),1,"") works indeed perfectly fine.
Also =COUNT(SEARCH({"Romney","Obama","Gingrich"},A1)) works.
But =SEARCH({"Romney","Obama","Gingrich"},A1) does not.
Also =ISNUMBER(SEARCH({"Gingrich","Obama","Romney"},A1)) does not work.
I'd love to know the reason why.
Ok, so this works:
OR(IFERROR(FIND("ab",A1,1),0),IFERROR(FIND("12",A1,1),0))
tested here :
I followed one of the links and the version like this:
=IF(COUNT(SEARCH({"Romney","Obama","Gingrich"},C1)),1,"")
worked as expected for me, but if the search is isolated it then fails and I have not found an explanation ...
Like other array-style formulas, the part that delivers the array has to be enclosed in some sort of aggregate function to make it scan through the array - otherwise it only looks at the first element of the array. So anything like COUNT, SUM, SUMPRODUCT will do the trick.
My preferred one is
=OR(ISNUMBER(SEARCH({"a","b","c"},A1)))
because you can easily change it to this if you want AND logic:
=AND(ISNUMBER(SEARCH({"a","b","c"},A1)))

MATCH function on Excel returns error

For some reason the MATCH function on excel returns an error.
Unfortunately I cannot share the data in order to replicate the problem but I was wondering if someone more experienced than I am could possibly find a small error in my code or something that I missed.
I used the functions according to these directions and I also I tried a solution here but neither source helped much.
=INDEX(IB_RAW!A2:L301,MATCH(1,(IB_RAW!$B:$B=IB!P10)*(IB_RAW!$D:$D=IB!A9)*(IB_RAW!$C:$C=IB!Q9)*(IB_RAW!$L:$L=IB!P7),0),IB_RAW!$J:$J)
I will try to describe the data as best as I can:
IB: The sheet where I want to show the extracted value
IB_RAW: The sheet where I get the information from
A2:L301: The whole dataset that I am using to look for the arguments
(in IB_RAW)
J: The value I want to extract (in IB_RAW)
The issue is with the MATCH function, as it returns #N/A, I've used the Show Calculation Steps... option to see where the problem is,
So for
(IB_RAW!$B:$B=IB!P10) returns TRUE
(IB_RAW!$D:$D=IB!A9) returns FALSE
(IB_RAW!$C:$C=IB!Q9) returns TRUE
(IB_RAW!$L:$L=IB!P7) returns TRUE
Therefore MATCH(1,0,0) but this returns #N/A instead.
Ok, The solution was from this detailed guide. It actually explains that you have to press Ctrl+Shift+Enter to activate the function and also I had to change the line of code a bit.
Hopefully this will be helpful to someone who wants to do the same thing like I did.
=INDEX(IB_RAW!I2:I301,MATCH(1,(IB_RAW!B2:B301=IB!P10)*(IB_RAW!D2:D301=IB!A9)*(IB_RAW!C2:C301=IB!Q9)*(IB_RAW!L2:L301=IB!P7),0))

Resources