# Specify the Phase based on the Dates

I have dates listed in Column A and I want to convert them to Phases in Column B; e.g. if the date is >= 5 Feb 2024 is equal to Phase 1 & if the date is >= 1 March 2024 is equal to Phase 2 and so on.

So far I've used this formula:

=IFERROR(ARRAYFORMULA(IFS(A:A<>"", IF(A:A >= DATE(2024,2,5), "Phase 1",IF(A:A >= DATE(2024,3,1), "Phase 2",IF(A:A >= DATE(2024,4,6), "Phase 3",IF(A:A >= DATE(2024,5,4), "Phase 4",IF(A:A >= DATE(2024,6,8), "Phase 5",IF(A:A >= DATE(2024,7,6), "Phase 6",IF(A:A >= DATE(2024,8,10), "Phase 7")))))))) ),"")

The problem with this formula is it always return Phase 1 no matter what the dates are. I have tried changing the Date format in column A but to no avail.

I'm open to any other method to group the date ranges into phases.

Use ifs(), like this:

=arrayformula(ifs(
A1:A = "", iferror(ø),
istext(A1:A), na(),
not(isdate_strict(A1:A)), na(),
A1:A < --"2024-02-05", iferror(ø),
A1:A < --"2024-03-01", "Phase 1",
A1:A < --"2024-04-06", "Phase 2",
A1:A < --"2024-05-04", "Phase 3",
A1:A < --"2024-06-08", "Phase 4",
A1:A < --"2024-07-06", "Phase 5",
A1:A < --"2024-08-10", "Phase 6",
true, "Phase 7"
))

See ifs() and double unary.

Similar approach to doubleunary but using a sorted lookup table and VLOOKUP instead of IFS:

=IFNA(ARRAYFORMULA(VLOOKUP(A2:A,
{ "2/5/2024"*1,  "Phase 1";
"3/1/2024"*1,  "Phase 2";
"4/6/2024"*1,  "Phase 3";
"5/4/2024"*1,  "Phase 4";
"6/8/2024"*1,  "Phase 5";
"7/6/2024"*1,  "Phase 6";
"8/10/2024"*1, "Phase 7"},2)))

OR the same formula using a table to manage the options:

=IFNA(ARRAYFORMULA(VLOOKUP(A2:A, C2:D8, 2)))
C D
1 Date Phase
2 02/05/2024 Phase 1
3 03/01/2024 Phase 2
4 04/06/2024 Phase 3
5 05/04/2024 Phase 4
6 06/08/2024 Phase 5
7 07/06/2024 Phase 6
8 08/10/2024 Phase 7