Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Jescanellas 2nd modification not working
- function numcharsbetweenocc2and3ofApple() {
- var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet4");
- var string1 = sheet.getRange(2, 2).getValues().toString();
- var apple_length1 = "apple".length;
- var first_apple1 = string1.indexOf("apple") + apple_length1;
- var second_apple1 = string1.indexOf("apple", first_apple1);
- var third_apple = string1.indexOf("apple", second_apple1);
- var result1 = third_apple - second_apple1;
- if (string1 !== "") {
- sheet.getRange(2, 3).setValue(result1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement