my spreadsheet link with edit authorized - feel free to test any formula
please look at the country that has statename such as P26-P38
I have 2 sheets - one is main sheet and another is named 'articles'
MAIN SHEET
ARTICLES
MAIN SHEET > on column P > I need to show the maximum date value located in column 'F' [articles!F:F] from 'articles' sheet by finding any rows on column 'B' of 'articles' [articles!B:B] that contains the number from column 'M' of 'Main sheet' [main!M:M] so I use this formula
=IFERROR(MAX(filter(articles!F:F,regexmatch(","&articles!B:B,","&M58&","))))
and its working fine
but then I also need to find state name which is located in 'column E of articles'[articles!E:E]
like in the screenshot above I need to find 'Alberta' for Canada as you can see the state name will come after '-' and follow by ':'
So it need to match both conditions and return the date
I don't know how can I define it in the formula 'regexmatch' and combine it together with the formula that I already have
I tried this but doesn't work
=IFERROR(MAX(filter(articles!F:F,regexmatch(","&articles!B:B,","&M58&","),articles!E:E,"-"&" "&K58&":")
anyone please help, thanks