Posts

Showing posts with the label google-spreadsheet

Google Sheets Auto Date and Time Stamp on Multiple Columns

Image
Clash Royale CLAN TAG #URR8PPP Google Sheets Auto Date and Time Stamp on Multiple Columns I want my Google Sheet to automatically do the following: I have already added named ranges for Columns A through E as follows: I found a code that lets me do the datestamp/timestamp thing, but it only works for one column (from https://www.internetgeeks.org/tech/add-timestamp-time-stamp-google-docs-spreadsheet/): function onEdit(event) { var timezone = "PST"; var timestamp_format = "MM-dd-yy"; var updateColName = "Title"; var timeStampColName = "Date"; var sheet = event.source.getSheetByName('Sheet1'); var actRng = event.source.getActiveRange(); var editColumn = actRng.getColumn(); var index = actRng.getRowIndex(); var headers = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues(); var dateCol = headers[0].indexOf(timeStampColName); var updateCol = headers[0].indexOf(updateColName); updateCol = updateCol + 1; if (date...

How to automatically import data from uploaded CSV or XLS file into Google Sheets

Image
Clash Royale CLAN TAG #URR8PPP How to automatically import data from uploaded CSV or XLS file into Google Sheets I have a legacy database system (not web accessible) on a server which generates CSV or XLS reports to a Google Drive folder. Currently, I am manually opening those files in Drive web interface and converting them to Google Sheets. I would rather this be automatic so that I can create jobs that append/transform and graph the data in other sheets. Is it possible to output a native .gsheet file? Or is there a way to convert CSV or XLS to .gsheet programmatically after saving it to Google Drive either in Google Apps or via a Windows based script/utility? google-spreadsheet-api can import data into an existing google spreadsheet. I suspect Drive API has a way to import as a new spreadsheet file, as I think I saw some code for the import on SO. – eddyparkinson Nov 11 '14 at 4:33 ...

Google Sheets move cursor onEdit trigger based on cell content

Image
Clash Royale CLAN TAG #URR8PPP Google Sheets move cursor onEdit trigger based on cell content I am trying to write a Google Sheets Apps Script function that checks the content of the current active cell, matches it to the content of another cell, then moves the cursor according to the result of that check. For a spreadsheet as this example one: https://docs.google.com/spreadsheets/d/1kpuVT1ZkK0iOSy_nGNPxvXPTFJrX-0JgNmEev6U--5c/edit#gid=0 I would like the user to go to D2, enter a value followed by Tab, then while the active cell is in E2, the function will check if the value in D2 is the same in B2. If it is, stays in E2. Then we enter the value in E2 followed by Tab, the function checks if it's the same as C2, if it is, then moves from F2 down and left twice to D3. So if all the values are entered correctly, the cursor zig-zags between the cells in D, E and F as shown below: The closest I could find is the answer to the one below, but it involves clicking on a method in the menu e...

Combine two sheets in Google sheets

Image
Clash Royale CLAN TAG #URR8PPP Combine two sheets in Google sheets I'm trying to combine two sheets in a Google Sheet. The first sheet contains a simple list of names similar to this: +--------+ | Name | +--------+ | Bob | | Vivian | | Fred | +--------+ The second sheet contains a list of tasks similar to this: +------------+---------+ | Task | Task ID | +------------+---------+ | Do Dishes | 1 | | Vacuum | 2 | | Do laundry | 3 | +------------+---------+ I want to combine these so that I get a sheet with those tasks for each name in separate rows: +--------+------------+---------+ | Name | Task | Task ID | +--------+------------+---------+ | Bob | Do Dishes | 1 | | Bob | Vacuum | 2 | | Bob | Do laundry | 3 | | Vivian | Do Dishes | 1 | | Vivian | Vacuum | 2 | | Vivian | Do laundry | 3 | | Fred | Do Dishes | 1 | | Fred | Vacuum | 2 | | Fred ...