Gathering all the unique values from one column and outputting them in another column..?

前端 未结 4 1702
眼角桃花
眼角桃花 2021-01-05 18:35

I have this form of a spreadsheet:

 A   B   C  D
abc abc abc 1
def ghi jkl 1
mno pqr stu 3
vwx yza bcd 4
mno pqr stu 5
mno pqr stu 5
vwx yza bcd 5
mno pqr st         


        
4条回答
  •  佛祖请我去吃肉
    2021-01-05 19:01

    You can do that inside google-spreadsheets with the UNIQUE function.
    Here is the doc to all available functions.
    (You find UNIQUE in the Filter category)

    Most likely you want to insert into cell E1:

    =UNIQUE(D1:D)
    

    This will populate column E with the unique values from all of column D while preserving the order. Furthermore this will dynamically update and reflect all changes made to column D.

    To do that from within google-apps-script:

    SpreadsheetApp.getActiveSheet()
     .getRange("E1").setFormula("=UNIQUE(D1:D)");
    

提交回复
热议问题