Aug 19 2024 03:06 AM - edited Aug 19 2024 03:17 AM
Hello,
my input data says this. Before 01-August, the administration of City 1 was overseen & supported by State 1
After 10th-August, City 1 was supported by State2, and from date 20th-Aug onwards, it is being supported by State3.
Like this i have many cities and corresponding states changing based on date values
How do i return the corresponding state value for a city, for that date condition ?
i m tried this in State Column. But not working.
=XLOOKUP([@City],DATEVALUE(Table1[[#Headers],[01-Aug-24]:[20-Aug-24]])>=[@Date],Table1[[01-Aug-24]:[20-Aug-24]],"",0,1)
Need suggestions for the match logic.
Thank you
kalyan
Thank you.
Aug 19 2024 03:43 AM
Try
=INDEX(Table1[[2024-08-01]:[2024-08-20]], XMATCH([@City], Table1[City]), XMATCH([@Date], DATEVALUE(Table1[[#Headers],[2024-08-01]:[2024-08-20]]), -1))
Aug 19 2024 03:57 AM
Aug 19 2024 04:01 AM
You have to use the names of the columns in your table:
=INDEX(Table1[[01-Aug-24]:[20-Aug-24]], XMATCH([@City], Table1[City]), XMATCH([@Date], DATEVALUE(Table1[[#Headers],[01-Aug-24]:[20-Aug-24]]), -1))
Aug 19 2024 08:16 AM
SolutionAs variant
=INDEX( XLOOKUP([@Date], 1*DROP(Source[#Headers],,1),DROP(Source,,1),,-1),
XMATCH([@City],Source[City] ) )
Sep 14 2024 05:19 AM
Sep 14 2024 05:58 AM
@KalyanPrasad , you are welcome
Aug 19 2024 08:16 AM
SolutionAs variant
=INDEX( XLOOKUP([@Date], 1*DROP(Source[#Headers],,1),DROP(Source,,1),,-1),
XMATCH([@City],Source[City] ) )