Search code examples
google-sheetstransposetrimflattengoogle-query-language

Google sheets get empty cells next to each other


Link: https://docs.google.com/spreadsheets/d/1hCG6jjGSGWMn5kBkDfcoTJkZ2eCC5SRvHWMFTBp_6OE/edit?usp=sharing

I want to return "Yes" or "No" results in column N when there are empty cells next to each other in the range B:M

And column O counts the number of times there are empty cells next to each other.

Thank you.


Solution

  • use in O2:

    =INDEX(LEN(SUBSTITUTE(FLATTEN(QUERY(TRANSPOSE(IF(REGEXMATCH(TRIM(
     SPLIT(FLATTEN(QUERY(TRANSPOSE(IF(B2:M5="", "×", "¤")),,9^9)), 
     "¤")), "× ×"), 1, )),,9^9)), " ", )))
    

    enter image description here


    use in N2:

    =INDEX(IF(O2:O=0, "No", "Yes"))