Forum Discussion
Maj786
Feb 25, 2024Copper Contributor
Help with an Excel Formula
Hello all, First time poster here. I need help on creating a formula on excel for the scenario below, please help as im really struggling Scenario: In sheet 1, I have a scenario (colum...
Patrick2788
Feb 25, 2024Silver Contributor
This formula is a little bit longer because of the data arrangement and taking into account a scenario that is different than the ones you've outlined (e.g. the result is not PASS and after UNIQUE is run and any instance of PASS is removed, there are 2 different statuses). Additionally, my solution does not use merged cells in F. Merged cells should be avoided because they do not play well with dynamic arrays and the look of merged cells can be achieved with borders and cell formatting.
=LET(
status_matrix, WRAPROWS(status, 3),
GetStatus, LAMBDA(current_row,
LET(
distinct, UNIQUE(current_row, 1),
ct, COUNTA(distinct),
no_pass, FILTER(distinct, distinct <> "PASS", ""),
mixed, IF(
COUNTA(no_pass) = 2,
"Please check status",
IF(no_pass = "No Run", "IN PROGRESS", no_pass)
),
IF(ct = 1, distinct, mixed)
)
),
results, BYROW(status_matrix, GetStatus),
TOCOL(EXPAND(results, , 3, ""))
)