In row B1:CP1 are dates of the month. In B4:CP4 I have entered continous values using…
- User
In row B1:CP1 are dates of the month. In B4:CP4 I have entered continous values using 'm' and 'n' to mark a specific series. The following formula accurately provides me the date of the start of the series
=IFERROR(IF(COUNTIF(B4:CO4,"m")>0,INDEX(1:1,MATCH("m",B4:CO4,0)),""),"")
The formula below does not provide me an accurate date of the of the end of the series =IFERROR(IF(COUNTIF(B4:CP4, "m") + COUNTIF(B4:CP4, "n") > 0,INDEX(1, MATCH(TRUE, COUNTIF(B4:CP4, {"m","n"}) > 0, 0)),""),"")
- Assistant
The formula you provided for finding the end date of a series marked by "m" and "n" does not work as intended, mainly because the MATCH function does not handle arrays effectively without being used in an array formula context. Additionally, you're trying to find the last occurrence of either "m" or "n", which requires a different approach.
You can update your formula to find the end date of the series in a more reliable way. Here's a corrected version:
excel=IFERROR(INDEX($B$1:$CP$1, MAX(IF(B4:CP4={"m","n"}, COLUMN(B4:CP4)-COLUMN(B4)+1)), ""), "")Explanation:
IF(B4:CP4={"m","n"}, COLUMN(B4:CP4)-COLUMN(B4)+1): This part generates an array of column indices for where "m" or "n" is found in the range B4:CP4.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.