Forum Discussion
Clare1487
Jun 26, 2023Copper Contributor
Returning multiple column headers based on duplicated dates within a row
Hi I have read many similar questions & answers, but none of the replies seem to work with my data. I have a spreadsheet with dates in varying order from left to right and some blank cells within ea...
Patrick2788
Jun 26, 2023Silver Contributor
Maybe this one. I tried to keep BYROW's usage to a minimum because it will be an issue on a larger data set.
=LET(
results, IF(data = target, header, ""),
BYROW(results, LAMBDA(row, TEXTJOIN(", ", 1, row)))
)
- Clare1487Jun 27, 2023Copper ContributorThank you so much for your help. Unfortunately this is not giving me the output I needed. Perhaps an error on my part inputting the formula(?) I'll upload a sample file in case that explains it. I have tried replacing blank cells with X but that hasn't made any difference.
I have typed
=LET(results, IF(T2 = D2:FY2, header, ""),BYROW(results, LAMBDA(row, TEXTJOIN(",",1,row))))
It just gives me the error #NAME?- Patrick2788Jun 27, 2023Silver ContributorIt might have issue with 'header' which is a defined name in my sample. It refers to the first row which contains the column headings.
- Clare1487Jun 28, 2023Copper ContributorThank you. Yes, that's working for me now. Fantastic, very much appreciated. Could the same formula be modified to look for the column headers corresponding to the first date after the target?