Hello, and thank you for looking.
I've finally reached my limit with this one, and created an account to seek help.
Desired Function in Sheet1(C3) to result in a name from Sheet2(column B).
Conditions:
1. The unique identifiers must match (identifiers will be listed only once each on Sheet1, but many duplicates on Sheet2)
2. The date in Sheet2(column C) must be less than (earlier) or equal to the date in Sheet1(C$1)
3. The date in Sheet2(column C) must be the maximum possible date that allows conditions 1 and 2 to be true
There are thousands of rows in Sheet2. I have the maximum row number calculated as an integer at cell Sheet2!($Z$2), and am using "Indirect("Sheet2!$A$1:$A$"&Sheet2!$Z$2) to calculate the range accurately and allow Macros to automatically fill down such things as the Desired Function, without filling beyond the row limits.
Here is the closest I've got, with help from this site (thank you):
=INDEX(INDIRECT("Sheet2!$B$1:$B$"&Sheet2!$Z$2),MATCH(MAX(IF(AND(INDIRECT("Sheet2!$A$1:$A$"&Sheet2!$Z$2)=Sheet1!$A2,INDIRECT("Sheet2!$C$1:$C$"&Sheet2!$Z$2)<=Sheet1!C$1),INDIRECT("Sheet2!$C$1:$C$"&Sheet2!$Z$2))),INDIRECT("Sheet2!$C$1:$C$"&Sheet2!$Z$2),0)))
Finally, just in case it's relevant, I've simplified the columns for this exercise.
On the actual sheets there are many columns in between, some empty, some filled with data. Columns C-E on Sheet1 will be next to one another, however.
Table 1 (Sheet1)
Table 2 (Sheet2)
Thank you again for looking.
Regards,
Frysk
I've finally reached my limit with this one, and created an account to seek help.
Desired Function in Sheet1(C3) to result in a name from Sheet2(column B).
Conditions:
1. The unique identifiers must match (identifiers will be listed only once each on Sheet1, but many duplicates on Sheet2)
2. The date in Sheet2(column C) must be less than (earlier) or equal to the date in Sheet1(C$1)
3. The date in Sheet2(column C) must be the maximum possible date that allows conditions 1 and 2 to be true
There are thousands of rows in Sheet2. I have the maximum row number calculated as an integer at cell Sheet2!($Z$2), and am using "Indirect("Sheet2!$A$1:$A$"&Sheet2!$Z$2) to calculate the range accurately and allow Macros to automatically fill down such things as the Desired Function, without filling beyond the row limits.
Here is the closest I've got, with help from this site (thank you):
=INDEX(INDIRECT("Sheet2!$B$1:$B$"&Sheet2!$Z$2),MATCH(MAX(IF(AND(INDIRECT("Sheet2!$A$1:$A$"&Sheet2!$Z$2)=Sheet1!$A2,INDIRECT("Sheet2!$C$1:$C$"&Sheet2!$Z$2)<=Sheet1!C$1),INDIRECT("Sheet2!$C$1:$C$"&Sheet2!$Z$2))),INDIRECT("Sheet2!$C$1:$C$"&Sheet2!$Z$2),0)))
Finally, just in case it's relevant, I've simplified the columns for this exercise.
On the actual sheets there are many columns in between, some empty, some filled with data. Columns C-E on Sheet1 will be next to one another, however.
Table 1 (Sheet1)
A | B | C | D | E |
30/09/2022 | 31/8/2022 | 31/7/2022 | ||
uniqueidentifierA | data_ignore | Desired Function | fill function | fill function |
uniqueidentifierB | data_ignore | fill function | fill function | fill function |
Table 2 (Sheet2)
A | B | C |
uniqueidentifier | Name 1 | date |
uniqueidentifier | Name 2 | date |
Thank you again for looking.
Regards,
Frysk