I was working on a Spreadsheet in Google Sheets a few days ago and needed to generate some random codes for my users. To do this, I just used the RANDBETWEEN(start val, end val) function built into Google Sheets.
It goes a little like this. If I want to build a 5 digit random number I would:
But this got me wondering. Is there a function for random Alphabetic strings or Alphanumeric strings or Alphanumeric with Character strings. The answer?
Sometimes, when you are working on a shared Google Sheet you might want to hide a row based on a cell value.
For example, perhaps we don’t want to see row information of orders that have been paid for. Take a look at my D&D miniatures wholesale orders sheet (image below). I know I don’t need to follow up the orders that have been paid, marked with a ‘Yes’ in column F, so I don’t want to see them on my sheet.
Let’s say you want to print out a list of expenditures by department and you want each department to start on a new page. You’ll also want to keep the same header for each page.
You might want to export a list of grades by class number. You sort the grades by class and then export the list with each class starting on a new page with a header and footer.
Sections to Sheets can help you achieve this quickly by creating a new Google Spreadsheet and separating each selection and putting it into a new Sheet(tab) with or without headers and footer. This will enable you to quickly export or print your sheets.
The NOW formula provides a date and time stamp at the time of execution or when the NOW() function is entered into the sheet.
The TODAY formula provides just the date at the time of execution or when the TODAY() formula is entered into the sheet.
Change the date when a cell is edited
That’s all well and good but I want this formula to occur when a user enters something in a cell.
To achieve this, we can use an IF statement. First, we will state if the cell is empty, then no date should appear. However, if the cell has a value in it, then the date and/or time the value was entered will appear in the corresponding cell.
Here’s the formula:
=IF(A2="","",TODAY()) <<Formula is celll D2
ِAs you can see in the IF statement we are saying; if there is nothing in cell A2 then don’t do anything, otherwise, if it contains a value then add today’s date in this cell, D2.
Now, if you want to have this ready for all rows for when a user adds to your data, then drag the formula all the way down to the bottom of the sheet.
Here is an example:
Ready to add some data? Here is what is would look like:
The NOW() and TODAY() functions are Dynamic. This means that they will update automatically. To keep these dates from changing, copy the cell and press <CTRL>+<SHIFT>+<V> or paste special> paste as value.
A Warning on NOW() and TODAY()
These two functions are Dynamic and will update constantly. If you are looking to get the date or time of something so that it does not update automatically then check out this tutorial :