You current formula is not set up correctly (nor logically). Given only what you've shown here, this should work:
=IF(AND( D2<DATE(YEAR(TODAY()),MONTH(TODAY())-20,DAY(TODAY())), REGEXMATCH(M2,"text") ),TRUE,FALSE)
Notice that the AND( ) contains both conditions here, whereas your original formula had it only around the second condition.
However, a shorter version of this would be as follows:
=AND( D2<DATE(YEAR(TODAY()),MONTH(TODAY())-20,DAY(TODAY())), REGEXMATCH(M2,"text") )
... since the result of a properly functioning AND( ) is always TRUE or FALSE anyway.
I'm trying to find a formula that will check the content of a cell, and give me different outcomes depending on what is written there (or chosen in a drop down list, if that's possible).
For context, I'm keeping inventory on items I sell, and I'd like if when I chose the size in a cell ("S", "M" or "L"), the next cell showing the price will automatically show the price corresponding to that size (in order, "4$" "5$" and "6$")
I've tried using "=IF", then "=IFS" functions, and even "=IF(or", but nothing works so far. I've triple-checked my syntaxe, but I'm new to this so maybe I missed something? Would there also be a simpler way that I'm missing?
In the image I'm using =IFS(D2<5;"S", IF(D2=5;"M", IF(D2>5;"L"))) and I tried replacing the semicolons by commas, still no go
Thanks!
EDIT:
Thanks to Squishiest-Grape for solving my problem (My Google Sheet was set to a language using comma number separators)! Everyone gave really good insight, I can now trouble-shoot my formulas much better!
if statement - Two conditions in Google Sheets Function - Stack Overflow
Formula help on IF AND with multiple conditions - Google Docs Editors Community
How to use IF statement with multiple conditions in Google Sheets
google sheets - How to write conditional formula for multiple conditions - Web Applications Stack Exchange
You current formula is not set up correctly (nor logically). Given only what you've shown here, this should work:
=IF(AND( D2<DATE(YEAR(TODAY()),MONTH(TODAY())-20,DAY(TODAY())), REGEXMATCH(M2,"text") ),TRUE,FALSE)
Notice that the AND( ) contains both conditions here, whereas your original formula had it only around the second condition.
However, a shorter version of this would be as follows:
=AND( D2<DATE(YEAR(TODAY()),MONTH(TODAY())-20,DAY(TODAY())), REGEXMATCH(M2,"text") )
... since the result of a properly functioning AND( ) is always TRUE or FALSE anyway.
It looks like you're supplying 4 arguments to the IF statement:
=IF(DATECHECK,AND(TEXTCHECK),TRUE,FALSE)
The IF statement expects 3 arguments instead. 1) the condition, 2) the value if true, and 3) the value if false. You can combine your two conditions using an AND statement like this:
AND(DATECHECK,TEXTCHECK)
The final formula would then be:
=IF(AND(D2<DATE(YEAR(TODAY()),MONTH(TODAY())-20,DAY(TODAY())), REGEXMATCH(M2,"text")),TRUE,FALSE)
here it is:
- https://docs.google.com/spreadsheets/d/

=IF(A2<>"",CONCATENATE(
IF(B2<>"",$B$1&": "&B2&CHAR(10),),
IF(C2<>"",$C$1&": "&C2&IF(OR(D2<>"",E2<>"",F2<>"",G2<>""),CHAR(10),),),
IF(D2<>"",$D$1&": "&D2&IF(OR( E2<>"",F2<>"",G2<>""),CHAR(10),),),
IF(E2<>"",$E$1&": "&E2&IF(OR( F2<>"",G2<>""),CHAR(10),),),
IF(F2<>"",$F$1&": "&F2&IF( G2<>"", CHAR(10),),),
IF(G2<>"",$G$1&": "&G2,)),)
Single Row Formula
=IFNA(JOIN(CHAR(10), FILTER({$B$1:$G$1 &": "& B2:G2}, LEN(B2:G2))))
Multi-Row Version
=BYROW(B2:G100, LAMBDA(row, IFNA(IF(LEN(OFFSET(row,0,-1,1,1)),
JOIN(CHAR(10), FILTER({B1:G1 &": "& row}, LEN(row))),))))