Search code examples
google-sheetsgoogle-sheets-formula

How to find empty and non empty cell element in google sheets?


Sheet Image

As per the attached snapshot of spreadsheet, I have putted some values in the cell A2:A9 and Cell B2:B9. In the said array B2:B9 some cell elements are empty and some are non empty. I have build formula in the cell C2

=QUERY(A2:B,"select Col1 where Col2 is not null")

to find non empty cell. To find empty cell I have build a formula in cell D2

=QUERY(A2:B,"select Col1 where Col2 is  null")

But, unfortunately i am not able to find required result as given in the cell E2:E9 and F2:F9 as attached in the snapshot. So kindly help me to finding corresponding empty and non empty cell.


Solution

  • non-blank

    =arrayformula(if(B2:B<>"",A2:A,))
    

    blank

    =arrayformula(if(B2:B="",A2:A,))