Forum Discussion
KONG84
Jun 24, 2022Copper Contributor
FIND OUT START AND END DATE
Hi, I have been stuck at this part for a while, anyone have any idea to find out the start and end date for item B when it is in Japan? Was thinking minifs+hlookup .....
- Jun 24, 2022
With Excel 2021 you can get both dates spilled with a single formula
- Data formated as Table1
- Named M3 & M4 respectively CritItem & CritCountry (not mandatory)in M5:
=LET( ItemCol, INDEX(Table1,,XMATCH(CritIem,Table1[#Headers])), IF(COUNTA(CritIem, CritCountry) < 2, "", CHOOSE(SEQUENCE(2), MINIFS(Table1[Date], ItemCol, CritCountry), MAXIFS(Table1[Date], ItemCol, CritCountry) ) ) )
Patrick2788
Jun 24, 2022Silver Contributor
A variant:
=LET(f,FILTER(Table1,Table1[#Headers]=CritIem),TRANSPOSE(XLOOKUP(CritCountry,f,Table1[Date],"",,{1,-1})))- KONG84Jun 26, 2022Copper Contributor
- KONG84Jun 26, 2022Copper ContributorMay I know what is 'f'?
- Patrick2788Jun 27, 2022Silver Contributorf refers to FILTER(Table1,Table1[#Headers]=CritIem)
The "" in XLOOKUP will return "" in the event of an error.
- LorenzoJun 24, 2022Silver Contributor
Or, with Patrick2788's idea:
=LET( f, FILTER(Table1,Table1[#Headers]=CritIem), XLOOKUP(CritCountry,f,Table1[Date],"",,{1;-1}) )