Hi All! I'm hoping there is a simple fix and I'm just not seeing, but I've been banging my head against a wall all day to write this formula.
I'm putting the formula in cell B2. What I want it to do is look at a date entered in cell C2, evaluate what date range it falls between, and display text in cell B2 based on the date range expression that evaluates true. For example, if the date in cell C2 between 2/1/2023 and 4/30/23, I want the text "FY24 Q1" to show in cell B2.
I'm using the IFS function to try and keep the nesting simple. And I'm using the AND function to evaluate the date range. And I've also tried it 2 different ways - one by enclosing each AND statement in parens and one by not enclosing each AND statement (I saw it done successfully both ways in a couple of YouTube videos). But I keep getting a Formula Parse Error.
Can anyone tell me what I'm doing wrong? Here are my two different attempts:
=IFS(AND(C2>=DATEVALUE("2/1/2023"),C2<=DATEVALUE("4/30/2023")), "FY24 Q1", AND(C2>=DATEVALUE("5/1/2023"),C2<=DATEVALUE("7/31/2023")), "FY24 Q2", AND(C2>=DATEVALUE("8/1/2023"),C2<=DATEVALUE("10/31/2023")), "FY24 Q3", AND(C2>=DATEVALUE("11/1/2023"),C2<=DATEVALUE("1/31/2024")), "FY24 Q4", TRUE," "))))
=IFS(AND(C2>=DATEVALUE("2/1/2023"),C2<=DATEVALUE("4/30/2023")), "FY24 Q1", (AND(C2>=DATEVALUE("5/1/2023"),C2<=DATEVALUE("7/31/2023")), "FY24 Q2", (AND(C2>=DATEVALUE("8/1/2023"),C2<=DATEVALUE("10/31/2023")), "FY24 Q3", (AND(C2>=DATEVALUE("11/1/2023"),C2<=DATEVALUE("1/31/2024")), "FY24 Q4", TRUE," "))))