-1

I want to hide the duplicate values of F column. QUERY('Orders'!A:G,"SELECT A, B, C, D, F, E WHERE G = 'Accepted' label A 'Time', E 'Delivery Address'") gives me the F column and i need to hide the duplicate values of that column. Now i'm doing it by making another column and hiding one. With the this if(F3<>F2,F3,""). It will be nice if I can do it in the same column within the query! Please help!

enter image description here

Imtiaz
  • 143
  • 1
  • 1
  • 8

1 Answers1

0

Assuming that your actual data starts at F2 and goes down to F12 (F1 being the column heading) and you want the unique values in column G (starting at G2), there are two ways:

  • To just see the unique vales as a list, type =UNIQUE(F2:F12) in G2

  • To show it against every change, as shown in your pasted image:

    • For simplicity, copy data in F2 to G2 as such
    • Write =IF(F3=F2, "", F3) in the third row of your desired column
    • Copy the formula all the way down to your last row (G12 in assumed scenario) by clicking and dragging the small dot at right bottom corner of the selected cell (while your mouse pointer appears as a plus sign)
  • To do it with query (I had earlier missed it) your query statement will be inside ArrayFormula, something like this:

    =ArrayFormula(query({A2:B12,if(C2:C12=C1:C11,"",C2:C12)},"select *"))

A2:C12 is your data (or the table)

C2:C12 is the column for which you need to show changed values only

C2:C12 has not been included intentionally in the data as that will display even those cells that you want to hide, in another column

Hope it now solves your problem

arshad
  • 159
  • 10
  • Thanks for the reply. I'm doing it with an extra column now. I'm actually looking for the query by which I'll be able to do that without adding an extra column. – Imtiaz Jun 20 '20 at 23:30
  • @Imtiaz Query method has been added so as to work without adding extra column – arshad Jun 21 '20 at 14:53