Jan 28 2022 09:30 AM
I'm looking to compare the last time a container was updated against the last time each of the items within said container were updated.
Each container can be filled with 1-10 items from a list of >200 items. If the items are revised, any container that has that item needs to be revised to have the most recent version replace the older version.
In one workbook, I have a sheet for "Containers" and a sheet for "Items"
The Containers sheet looks something like this:
Update Logic | Container ID | Location | Last_Updated | Item_1 | Item_2 | Item_3 |
0001 | Office 204 | 2022-01-15 | Red | Blue | Yellow | |
0002 | Office 101 | 2022-01-22 | Green | Purple |
The Items sheet looks something like:
Item_Name | Last_Updated |
Red | 2021-12-28 |
Blue | 2022-01-10 |
Yellow | 2022-01-25 |
Green | 2022-01-25 |
Purple | 2022-01-18 |
I used:
=IF([@[Last_Updated]]<XLOOKUP([@[Item 1]],Items[Item],Items[Last_Updated],,,1),"YES",IF([@[Last_Updated]]<XLOOKUP([@[Item 2]],Items[Item],Documents[Last_Updated],,,1),"YES",IF([@[Last_Updated]]<XLOOKUP([@[Item 3]],Items[Items],Items[Last_Updated],,,1),"YES","")
Which worked, but only if "Item" cells were all filled (which is often the case, but not strictly so) and if the Container "Last Updated" was less than one of the Items "Last Updated".
Both of the "Last Updated" columns will be manually entered. There is no logic in any cells other than the first column of the "Containers" sheet.
I'm hoping to find a solution that:
1. Returns the correct value for both up to date and out of date Containers.
2. Has more concise logic.
I'm trying to learn as many ways to go at a problem as possible and usually I can find a work around, but this one has me pretty stumped so I know I'm missing something. I'm just not sure what.
Thanks in advance.
Jan 28 2022 11:41 AM
SolutionThat could be like
=IF( [@[Last_Updated]] <
MAX(
IFNA(
INDEX( Items[Last_Updated],
XMATCH(Table1[@[Item_1]:[Item_3]], Items[Item_Name] )
),
0 )
),
"Yes", "No" )
Jan 28 2022 11:54 AM
@Sergei Baklan That did it! And I think I can piece together how and why. Thank you very much, Sergei!
Jan 28 2022 11:41 AM
SolutionThat could be like
=IF( [@[Last_Updated]] <
MAX(
IFNA(
INDEX( Items[Last_Updated],
XMATCH(Table1[@[Item_1]:[Item_3]], Items[Item_Name] )
),
0 )
),
"Yes", "No" )