英文:
Checking if any of the occurrence for IDs in list 'A' has happened after date in list 'B' for the same ID
问题
在Table A中,需要查找在任何情况下,其'arrival date_International'在Table B中的'arrival date_Domestic'之后的ID。
英文:
Hope I can find pointer to right direction:
Table 'A' with several IDs reoccurring with different dates (arrival date_Domestic)
Table 'B' with several IDs reoccurring with different dates (arrival date_International)
I need to find IDs where in Table A on any occurrence their 'arrival date_International' was after (>) 'arrival date_Domestic' in Table B
I cant just do if date B > date A as it need to check for the particular ID, also tried =IF(MAX(FILTER($F$3:$F$15,$E$3:$E$15=A3))>B3,"Y","N")
but it just check against a row not taking ID in consideration.
Any help will be appreciated.
答案1
得分: 3
You need to filter for ID and date.
=IF(SUMPRODUCT((tblA[ID]=[@ID])*(tblA[date_int]>[@[date_dom]])),"Y","N")
Using the new LET
-formula might make it more readable:
=LET(maxDateDom,MAX(FILTER([date_dom],[ID]=[@ID])),
maxDateInt,MAX(FILTER(tblA[date_int],tblA[ID]=[@ID])),
maxDateInt>maxDateDom)
But you are inconsistent in your question regarding which date to be after which.
If you want date_int < date_dom then switch to tblA[date_int]<[@[date_dom]
in the formula.
英文:
You need to filter for ID and date.
=IF(SUMPRODUCT((tblA[ID]=[@ID])*(tblA[date_int]>[@[date_dom]])),"Y","N")
Using the new LET
-formula might make it more readable:
=LET(maxDateDom,MAX(FILTER([date_dom],[ID]=[@ID])),
maxDateInt,MAX(FILTER(tblA[date_int],tblA[ID]=[@ID])),
maxDateInt>maxDateDom)
But you are inconsistent in your question regarding which date to be after which.
If you want date_int < date_dom then switch to tblA[date_int]<[@[date_dom]
in the formula.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论