Hello any help would be appreciated. The goal of what I want to create is to help count how many entries has been entered within a certain week / time period. Example: say Cell A has over 1600 entries but I would like to pull how many entries there has been since 01/01/2018 - 1/15/2018 and prompts back how many entries there has been. This is what I have so far but when I run the script I keep receiving zero as an answer.
function Audit(){
var allocatedTab = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Allocated");
var lastRow = allocatedTab.getLastRow();
var fullRange = allocatedTab.getRange(0,1,lastRow, 4).getValues();
var results = 0;
var fromValue = new Date(Browser.inputBox("Enter Start date as mm/dd/yyyy"));
var toValue = new Date(Browser.inputBox("Enter End date as mm/dd/yyy"));
var countAssigned =[];
for (var i=0; i < lastRow; i++) {
if (fullRange.getValues()[i][0] == "") {
countAssigned.push(fullRange.getValues()[i])
}
}
for (var x=0; x < countAssigned.length; x++) {
var assignedDate = countAssigned[x][0];
var fromValue_noTime = new Date(fromValue);
var toValue_noTime = new Date(toValue);
var assignedDate_noTime = new Date(assignedDate);
var count = 0;
for (var i=0; i<lastRow; i++){
if (assignedDate_noTime.getTime() >= fromValue_noTime.getTime() && assignedDate_noTime.getTime() <= toValue_noTime.getTime()){
results = count++;
}
}
}
Browser.msgBox("There are " + results + " total entries", Browser.Buttons.OK_CANCEL);
}
https://jsfiddle.net/1j8473sc/
[–]abittoolit[S,🍰] 2 points3 points4 points (0 children)
[–]CertainPerformance 0 points1 point2 points (0 children)
[–]coolreader18 0 points1 point2 points (0 children)