Search code examples
if-statementgoogle-sheetsformulacase-insensitivegoogle-query-language

How to change this formula to be case insensitive


I have this formula I am using in a tab I set up as a search engine for the tab Programs where I am keeping detailed information about a large number of programs. I have a several search criteria I can use for finding a list of programs to look through. The formula works well this way but I would like to make it case insensitive. I've done a little searching online for solutions but I'm afraid I don't currently have enough time to come to a complete understanding of how to make this work - I'm not a programmer and need to have considerable time to go in and work on more complex formulas to make them happen. I'm wondering if someone who's already familiar can give me a hand?

=QUERY(Programs!A3:V, 
 "where "&TEXTJOIN(" "&A2&" ", 1, 
 IF(B2<>"", " B='"&B2&"'", ), 
 IF(C2<>"", " C='"&C2&"'", ), 
 IF(D2<>"", " A='"&D2&"'", ), 
 IF(E2<>"", " E='"&E2&"'", ), 
 IF(F2<>"", " F="&F2&"", ), 
 IF(G2<>"", " G='"&G2&"'", ), 
 IF(H2<>"", " H='"&H2&"'", ), 
 IF(I2<>"", " I='"&I2&"'", ), 
 IF(O2<>"", " O='"&O2&"'", ), 
 IF(P2<>"", " P='"&P2&"'", )))

Solution

  • try:

    =QUERY(Programs!A3:V, 
     "where "&TEXTJOIN(" "&A2&" ", 1, 
     IF(B2<>"", " lower(B)='"&lower(B2)&"'", ), 
     IF(C2<>"", " lower(C)='"&lower(C2)&"'", ), 
     IF(D2<>"", " lower(A)='"&lower(D2)&"'", ), 
     IF(E2<>"", " lower(E)='"&lower(E2)&"'", ), 
     IF(F2<>"", " F="&F2&"", ), 
     IF(G2<>"", " lower(G)='"&lower(G2)&"'", ), 
     IF(H2<>"", " lower(H)='"&lower(H2)&"'", ), 
     IF(I2<>"", " lower(I)='"&lower(I2)&"'", ), 
     IF(O2<>"", " lower(O)='"&lower(O2)&"'", ), 
     IF(P2<>"", " lower(P)='"&lower(P2)&"'", )))