Search code examples
google-sheetsgoogle-sheets-formulaarray-formulasgoogle-sheets-querygs-vlookup

How to get Date/ Time to work with Data Validation and INDEX(MATCH()) or VLOOKUP


I'm trying to set up a summary sheet that pulls relevant information based on input from three Data Validation drop-downs.

Link to the sheet: https://docs.google.com/spreadsheets/d/1LlOdONYI6hd2U5uVmD4C5i3WpuieOdohxIAnwfudUC8/edit?usp=sharing

I have a QUERY in 'Calculations'!E2, with Data Validation in 'Calculations'!F2 based on the results in 'Calculations'!E2, then two other QUERY in 'Calculations'!G2 and 'Calculations'!I2 with accompanying Data Validation in 'Calculations'!H2 and 'Calculations'!J2 respectively.

My first problem is when I get to the Data Validation in 'Calculations'!J2: Regardless of whether the selection looks identical to one of the times displayed in 'Calculations'!C:C, I always get an "Input must fall within the specified range" error.

My second problem: I can't get a formula to work that pulls the information I'm looking for from the "Form Responses" sheet. I've tried an INDEX(MATCH()) in 'Summary'!A8, and a VLOOKUP in 'Summary'!A10, but both say they can't find the date from 'Calculations'!J2. I've tried adding/ removing significant digits with formatting and ROUND functions, but it won't match even though the data should be identical (the number in 'Calculations'!J2 is literally pulled directly from the dates in 'Form Responses'!A2:A, isn't it? Is that the problem?).

Thanks in advance for the help!


Solution

  • E2:

    =UNIQUE(QUERY(A2:A, "where A is not null", 0))
    

    G2:

    =UNIQUE(QUERY(A2:C, "select B where A = '"&F2&"'", 0))
    

    I2:

    =ARRAYFORMULA(N(QUERY(A2:C, "select C where A = '"&F2&"' and B = '"&H2&"'", 0)))
    

    K2:

    =ARRAYFORMULA(IFNA(VLOOKUP(J2, {C2:C, A2:C}, {2, 3, 4}, 0)))
    

    0