I have a google sheet with a column of dates, and I cant display or set the value to a cell if the values on my column reaches 4 times (e.g. July 1, 2019)
Date Column
Row1: July 1, 2019
Row2: July 2, 2019
Row3: July 1, 2019
Row4: July 4, 2019
Row5: July 1, 2019
Row6: July 1, 2019
Row7: July 5, 2019
i have tried the code below in google script:
function countDate(){
var ss = SpreadsheetApp.openByUrl(url);
var ws = ss.getSheetByName("Test_Data");
var dateRg = ws.getRange(1, 9, ws.getLastRow(), 1).getValues();
for (var i =1; i < dateRg.length; i++){
var dateTest = dateRg[i];
if (dateTest > 5){
ws.getRange(2,4).setValue(dateTest);
}
}
In the example above, i would like to have a cell in my spreadsheet to have the value "July 1, 2019" since it appears 4 times in the column. Thank you in advance.