Google-sheets – Synchronize time among several concurrent users

google sheets

I'm using Google Sheets to come up with a quick Jeopardy-style game with an improvised buzzer. All players type in the timestamp shortcut (Ctrl+Shift+0) into a cell and the lowest value is presumed to buzz in first, but we've realized that some people are a few seconds, even minutes, ahead (or behind). We've diagnosed that it's related to each person's time set in each's OS.

Is there a way to sync times through the Sheets app? Or at the very least determine who input first?

I've tried to remedy with a series of nested array formula with if and count statements, but to no avail. Any help would be appreciated. Otherwise I'm going to set my OS's time to 1899 and smoke everyone.

Best Answer

Some features depends on local resources as you already figured out. You could try to use a macro to calculate the time using server resources instead of the local ones.

  1. Save a macro



  1. Edit the code
/** @OnlyCurrentDoc */

function timestamp(){
  var spreadsheet = SpreadsheetApp.getActive();
  spreadsheet.getCurrentCell().setValue(new Date());
}

The first time you run the macro you should authorize it, but this is a one time thing.

Reference