SOLVED

Date matching when doing lookup - help needed

%3CLINGO-SUB%20id%3D%22lingo-sub-1852930%22%20slang%3D%22en-US%22%3EDate%20matching%20when%20doing%20lookup%20-%20help%20needed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1852930%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%2C%3C%2FP%3E%3CP%3EI'm%20trying%20to%20combine%20a%20lookup%20formula%20with%20a%20date%20matching%20query%2C%20but%20have%20not%20managed%20to%20make%20this%20work%20so%20any%20suggestions%20are%20welcome.%20For%20the%20attached%20files%2C%20I%20want%20to%20only%20show%20results%20with%20dates%20in%20October%202020.%3C%2FP%3E%3CP%3EI%20collate%20estate%20inspections%20made%20by%20our%20housing%20teams%20in%20a%20separate%20sheet%2C%20and%20then%20match%20these%20with%20the%20actual%20property%20listings%20to%20show%20progress.%20Traditionally%2C%20the%20inspection%20results%20have%20been%20manually%20separated%20into%20months%2C%20but%20I%20would%20like%20to%20automate%20this%20process%2C%20and%20this%20is%20where%20the%20problem%20arises.%20The%20attached%20files%20are%20a%20cutdown%20version%20of%20my%20dataset%20to%20just%20show%20the%20issues.%3C%2FP%3E%3CP%3EIn%20the%20Master%20Monitor%20Test%20book%2C%20column%20B%20does%20a%20simple%20XLOOKUP%20from%20Cleaning%20Survey%20extract%200.5%20-%20this%20works%20fine%2C%20I'm%20ok%20with%20the%20format%2C%20but%20it%20pulls%20through%20every%20match%20disregarding%20dates.%20Column%20C%20is%20my%20latest%20attempt%20at%20adding%20a%20date%20matching%20component%2C%20but%20as%20can%20be%20seen%2C%20this%20does%20not%20work%20at%20all.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20help%20or%20suggestions%20are%20really%20welcomed.%20If%20it%20means%20VBA%2C%20it's%20not%20something%20I'm%20super%20comfortable%20with%2C%20so%20I%20would%20prefer%20a%20formula%20based%20solution.%20However%2C%20if%20VBA%20is%20the%20way%2C%20who%20am%20I%20to%20say%3F%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%20The%20only%20constraint%20I%20have%20is%20the%20report%20output%20format%20(ie%2C%20the%20Cleaning%20table)%2C%20this%20is%20fixed%20by%20the%20business%2C%20but%20I'm%20open%20to%20suggestions.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMany%20thanks%2C%3C%2FP%3E%3CP%3EErik%20Nolander%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1852930%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1853084%22%20slang%3D%22en-US%22%3ERe%3A%20Date%20matching%20when%20doing%20lookup%20-%20help%20needed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1853084%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F856993%22%20target%3D%22_blank%22%3E%40ErikNolander%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EErik%2C%20perhaps%20you%20mean%20something%20like%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DXLOOKUP(%0A%20%20%20%20%5B%40%5BScheme%2FEstate%5D%5D%26amp%3B%22%3D%22%26amp%3BMONTH(%24B%244)%2C%0A%20%20%20%20'Cleaning%20Survey%20extract%200.5.xlsx'!tbl_survey%5BScheme%20Name%5D%20%26amp%3B%0A%20%20%20%20%20%20%20%20%20%20%22%3D%22%20%26amp%3B%0A%20%20%20%20%20%20%20%20%20%20MONTH('Cleaning%20Survey%20extract%200.5.xlsx'!tbl_survey%5BDate%20of%20inspection%5D)%2C%0A%20%20%20%20'Cleaning%20Survey%20extract%200.5.xlsx'!tbl_survey%5BInternal%5D%2C%0A%20%20%20%20%22not%20rated%22%0A)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi all,

I'm trying to combine a lookup formula with a date matching query, but have not managed to make this work so any suggestions are welcome. For the attached files, I want to only show results with dates in October 2020.

I collate estate inspections made by our housing teams in a separate sheet, and then match these with the actual property listings to show progress. Traditionally, the inspection results have been manually separated into months, but I would like to automate this process, and this is where the problem arises. The attached files are a cutdown version of my dataset to just show the issues.

In the Master Monitor Test book, column B does a simple XLOOKUP from Cleaning Survey extract 0.5 - this works fine, I'm ok with the format, but it pulls through every match disregarding dates. Column C is my latest attempt at adding a date matching component, but as can be seen, this does not work at all. 

 

Any help or suggestions are really welcomed. If it means VBA, it's not something I'm super comfortable with, so I would prefer a formula based solution. However, if VBA is the way, who am I to say? The only constraint I have is the report output format (ie, the Cleaning table), this is fixed by the business, but I'm open to suggestions.

 

Many thanks,

Erik Nolander

3 Replies
best response confirmed by ErikNolander (New Contributor)
Solution

@ErikNolander 

Erik, perhaps you mean something like

=XLOOKUP(
    [@[Scheme/Estate]]&"="&MONTH($B$4),
    'Cleaning Survey extract 0.5.xlsx'!tbl_survey[Scheme Name] &
          "=" &
          MONTH('Cleaning Survey extract 0.5.xlsx'!tbl_survey[Date of inspection]),
    'Cleaning Survey extract 0.5.xlsx'!tbl_survey[Internal],
    "not rated"
)

@Sergei Baklan thank you - this works perfectly! This is really going to save time and improve our workflow.

Really grateful for your quick response and help!

 

Regards,

Erik

@ErikNolander , you are welcome, glad to help