Click on an empty cell in your sheet, this will be where the results will populate.
In our example we have highlighted cell D6 which is next to the data set and under the header of ‘Unique Results’
2. Enter the formula =UNIQUE(QUERY(cellRef1:cellRef2 , "Cell column comparison = 'Cell Value'"))
In the empty cell, input the formula in the format of: =UNIQUE(QUERY(Cell_ref1:Cell_ref2, "Cell column comparison= 'Cell Value'"))
UNIQUE: This function identifies and removes duplicate entities from a dataset or individual cell ranges.
QUERY: The Query function selects what to display and contains the parameters of the search
CellRef1: This is the reference of the first cell you need to compare. (As an example - A3)
CellRef2: The reference of the second cell or range you need to compare. (As an example - B11), you can also check a range of cells by inputting a cell range here instead. (example - B3:B11).
Cell column comparison: Compares values in specified columns and returns rows where a specified condition is true.
In our example below It tells the QUERY() function to compare the values in columns A and B for each row in the range A3:B11 and only return the values from column A where the corresponding cell value (see below) in column B is "yes".
Cell Value: The formula will return the result that is designated in this selection, for example ‘yes’ or ‘no’.
In our example, the formula will check the cell references in column A and B and if they equal the result of ‘yes’. Our example formula is:
=UNIQUE(QUERY(A3:B11,"select A where B = 'yes'"))
3. Press Enter to populate the results
With the formula inputted, simply press the Enter key. The formula will run and the results will populate.
In our example we checked if any cells in the data set in the B column returned ‘yes’, the returned results are the names that correspond with this result in column A