Forum Discussion
Excel Formula help, IFS function
I am trying to write an IFS statement to determine if a date falls within a certain date range.
Date Range: is in Sheet 2 (see below)
A | B | C | |
1 | FY18 | 7/1/2017 | 6/30/2018 |
2 | FY19 | 7/1/2018 | 6/30/2019 |
3 | FY20 | 7/1/2019 | 6/30/2020 |
I have written the formula to check if the date in cell I22 is greater than or equal to the date in Sheet 2 Cell B1, less than or equal to date in Sheet 2 Cell C1, if yes return "FY18". I repeat this for all scenarios but it is not working. Can someone help?
=IFS(I22>=Sheet2!$B$1,"FY18",(I22<=Sheet2!$C$1),"FY18",IF(I22>=Sheet2!$B$2),"FY19",IF(I22<=Sheet2!$C$2),"FY19",IF(I22>=Sheet2!$B$3),"FY20",IF(I22<=Sheet2!$C$3),"FY20")
12 Replies
- MisterECopper Contributor
Upon analyzing your formula, I believe you need an AND statement in your if statement. For example for row 1, your formula would look like:
=IF(AND(I22>=Sheet2!B1,I22<=Sheet2!C1),Sheet2!A1," ")
Basically, it displays the value FY18 if true, else display space(" ") if false.
- SergeiBaklanDiamond Contributor
Perhaps
=INDEX(Sheet2!$A:$A,MATCH(1,INDEX(($I$22>=Sheet2!$B:$B)*($I$22<=Sheet2!$C:$C),0),0))
- MSTworkCopper Contributor
My original formula is working, however it only returns the result "FY18" even if the date falls in one of the other fiscal years.
- SergeiBaklanDiamond Contributor
- MSTworkCopper Contributor
SergeiBaklan no luck 😞
- MSTworkCopper Contributor
FY isn't fixed on those dates. The date could fall between those date ranges and if it does I want the true statement to be FY18, FY19, or FY20 depending on what date is in I22.
I don't think the Vlookup will work.