I have two tables. Table A= Customer Feedback Table B= KPI

In Table A I have a column for a date with format mm/dd/yyyy

and in Table B I have 2 columns as from date and to date with the format.

I want a count of all rows from Table A that lies within from date and to date in Table B

I am using below query:

 "select Col9 where Col8 = '"&Sheet1!A2&"' and Col4 > date 
 '"&TEXT('"&Sheet1!J2&"',"yyyy-mm-dd")&"' and Col4 <= date 
 '"&TEXT('"&Sheet1!K2&"',"yyyy-mm-dd")&"' ",1))

this query works fine if there is no date verification involved:

 "Customer_Feedback_Report!A2:L250"),"select Col9 where Col8 = '"&Sheet1!A2&"' "))

but with date verification it is showing error. Can anyone help?

1 Answer 1


you got #ERROR! because you wrapped Sheet1!J2 and Sheet1!K2 between '"& &"' ...try:

             "select Col9 where Col8 = '"&Sheet1!A2&"' and Col4 >  date 
             '"&TEXT(Sheet1!J2, "yyyy-mm-dd")&"'       and Col4 <= date 
             '"&TEXT(Sheet1!K2, "yyyy-mm-dd")&"' ", 1))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.