How do I reverse the Rows in A Column in Google Sheets?

Reverse Rows in Column in Google Sheets
My favourite Killjoy members. Column A – From most favourite. Column B Saving the best for last.

Sometimes you have a need to reverse a list quickly in Google Sheets.

That’s pretty easy to do if the list is sorted alphabetically. Just go on into the <Data> menu and choose from one of the sort functions. But what if the data you want to flip is not in alphabetical or numeric order?

Below are 3 ways to reverse your data:

For the examples below, I’ll be using a list of my favourite Killjoys characters. Yeah, I’m a sci-fi geek.

Continue reading “How do I reverse the Rows in A Column in Google Sheets?”

Add the Current Date to a Sheet When Data Is Added So That The Date Does Not Change(Static) – Google Sheets

You’ve probably come across the problem where you need to know when a piece of data has been added to your spreadsheet. You probably have been equally frustrated that there is no out-of-the-box function that will do just this.

You’ve tried TODAY() and NOW(), but they change dynamically. What you really need here is something that does not change.

Let’s look at two workarounds that can help you out with this problem.

Continue reading “Add the Current Date to a Sheet When Data Is Added So That The Date Does Not Change(Static) – Google Sheets”

How to Get Something from Google Sheets and Display it in the Sidebar in Google Apps Script

What if you want to get a value or a range from Google Sheets and show it in your sidebar using Google Apps Script?

First you will need to get the value or range by using Googles server-side script. Then you will have to display it client-side in your HTML document.

Documentation on getting the server-side and client-side talking nicely to each other is a little vague. Hopefully, this very basic tutorial will help clear things up.

In this tutorial I will also be using Jquery.

Let’s get started.

Continue reading “How to Get Something from Google Sheets and Display it in the Sidebar in Google Apps Script”

Add the Current Date When Data is Added to a Cell(Dynamic) – Google Sheets

A colleague of mine had recently asked me if there was a way to automatically display the day’s date when a cell has data in it without having to use Google Apps Script.

My answer: “Why yes, there is Jim.”

There are two really cool tools that you can use in Google Sheets to get the current date or time and date:

The NOW formula provides a date and time stamp at the time of execution or when the NOW() function is entered into the sheet.

NOW Google Sheets

The TODAY formula provides just the date at the time of execution or when the TODAY() formula is entered into the sheet.

TODAY Google Sheets

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:

IF value DATE Google Sheets

Ready to add some data? Here is what is would look like:

Current Date Added When Cell is Entered

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 :

Add the Current Date to a Sheet When Data Is Added So That The Date Does Not Change(Static) – Google Sheets




You can do exactly the same thing with the NOW formula. Give it a try.

Skewed Random Range in Google Sheets (RANDBETWEEN)


We can achieve a random range of numbers in Google Sheets by using the RANDBETWEEN formula. The formula is quite simple to use. Just add your start range and your end range:

=RANDBETWEEN(start range, end range)

For example, if I want to get a random number between zero(o) and 60 I would do the following:


The result will provide a whole random number somewhere between these two and including these numbers.

If I were to repeat this formula over a reasonable sample, say 300 times, we should see a fairly even spread of numbers occurring a roughly the same frequency, just like in the graph below:

But what if we wanted to have fewer random numbers in our list at the lower or upper end or on both ends?

Continue reading “Skewed Random Range in Google Sheets (RANDBETWEEN)”

How do I Randomly Assign People to a Group Without Doubling Up on the Same Group in Google Sheets

Random Combinations Without Repetition Using Arrays, TRANSPOSE and Randomize Ranges

Say you have a list of  30 people and a 30 list of groups. After every half hour for six hours the people must change to another group, but they cannot go back to a group they have already been in.

How can we schedule 12 sessions where every person can randomly go to another group without going to the same group twice?

This is pretty much the same issue I face when scheduling my teachers to proctor exams randomly each quarter for different classes. The rules I need to follow are:

  1. No teacher should proctor the same class twice.
  2. Assignment to proctor a class should seem random.
  3. The teacher that teaches the class cannot proctor their own class.
  4. Each week has an exam over the term. The term runs for 8 weeks plus a final requiring a total of 9 proctor sessions.

Continue reading “How do I Randomly Assign People to a Group Without Doubling Up on the Same Group in Google Sheets”

VLOOKUP Left in Google Sheets with INDEX and MATCH

Ever been faced with an issue where you can’t move your column to the far left in order to Vlookup? I just came across this issue recently.

The Problem – Vlookup

I needed to add teachers to a list of students who had to move into their class for two tests because their teacher (Hanna John-Kamen) would be absent on the test day.

Sheet: Hannah 302-15. Students split into other class sections.
Sheet: Hannah 302-15. Students split into other class sections.


Essentially, I was splitting the students into the remainder of the classes for that session time. In this student list sheet (Hannah 302-15) I had allocated the students new rooms and each room had a new teacher.

I couldn’t change the teacher proctors test list sheet ( Q2U1 Teacher) because the teachers who reference it would get confused. Unfortunately the teachers name I wanted was in column B and the reference (The Speaking classroom) was in column I.


Just like Zoolander, I can't Vlookup Left
Sheet: Q2U1 Teacher. Just like Zoolander, I can’t Vlookup Left

I need to put my first Vlookup in M2 of the Hannah 302-15 sheet.  If I tried to Vlookup it might look like this: =VLOOKUP(L2,‘Q2U1 Teacher’!B:I,8,False). Where L2 is the class I am searching for in the Hannah 302-15 sheet. ‘Q2U1 Teacher’!B:I is the range where B is the name column and I is the Class number. is clearly wrong. Vlookup will not accept a negative reference (It’s stupid, I know). False: because the list was not sorted. 

So what to do.

Continue reading “VLOOKUP Left in Google Sheets with INDEX and MATCH”

Spacer – Free Google Add-On That Spaces Row by Column Category

What is Spacer?

Spacer is a Free Google Add-On that creates row spaces by column categories.

I use it as an academic administrator to create a space or two at the end of each class section to create a visual break between sections. This makes it easier for my staff to quickly identify class sections.

You can find Spacer at the Google Chrome Webstore.

Chrome Web Store Badge

What can Spacer do?

Spacer can:

  • Automatically detect the width of your columns.
  • Allow you to select a column with the categories you want to use to space your data.
  • Set the height of your header – so that is not spaced too.
  • Set the thickness of your spaces.
  • Set the color of your spaces
  • Set starting and end position of your color filler.

How to use Spacer

After Installation

Before You Start:

  1. Before you start, create a Google Sheet with the data in it you want to space.
  2. Select All the data.
  3. Go to the menu bar and select: Data>Sort Range...   and select the column you want to sort by. This will be the column you will use to space your data by the categories in that column.
Running Spacer:
  1. In a Google Sheet, select the Add-Ons menu.
    Google Sheets Add Addon
  2. Select: Spacer>Create SpacesOpen Spacer for Google Sheets
  3. sidebar will appear to the right.
    spacer sidebar for Google Sheets
  4. Choose the column you want to use to Space your data.
  5. Choose how high your header is.
  6. Chose how thick or deep your want your header to be.
  7. If you want a color, select a color that you want to add to your spaces.
  8. Select where you want to start the color and end the color.
  9. Click: Submit
  10. If you are not happy with the color, space, color width or made a mistake, simply click: UNDO

I keep getting the following popup:

troubleshooting Spacer

This is because the starting value of your Color Width is greater than your End value:

Spacer RightSpacer Wrong

An Example

I have a list of people with their favorite color and fruit. Let’s say I want to sort the Google Sheet by favorite color (Fav Color) and put a space at the end of each color category to make it easier to read.

My data looks like this:

Favorite Data Example

To space this data we must do the following:

  1. Select all the data: ctrl+shift + a
    Select Data
  2. Sort the data by column B. Select: Data> Sort range
    sort data select range
  3. Click the: Data has a header row  tick box. Select the column: Fav Color. Then click the Sort button.
    Sort Range by column
  4. Your data is now sorted by favorite color:
    sorted by fav color
  5. Time to use the Spacer. Select: Add-ons > Spacer > Create spaces
    execute spacer
  6. Spacer will open at Sidebar on the right:
    spacer sidebar for Google Sheets
  7. We want to space our data by Fav Color which is column B. For Column, select: B
    Spacer Select Column
  8. We have a single Row Header so we can leave the header selection at 1:  Spacer header height
  9. We want to give our spaces a thickness of 2 rows:
    Spacer Thickness
  10. Next, we choose a color. Let’s choose purple. A color picker will pop up (the picker may vary depending on your system) select the color and click: OK:                             Spacer color
  11. This is the result:
    Spacer color result
  12. Now choose where to start and finish the color fill for the space. I’ll start it at column A and end it at column E.
    Spacer start and finish color
  13. Finally click Submit:
  14. This will be the result:
    Spacer result


Privacy Policy | Terms of Use

How do I lock certain cells in a formula in Google Sheets?

You know, I’m pretty confident in my use of Google Sheets. I use a lot of it’s advanced features and formulas in my daily work.

But one thing was bugging me. Every time I created a formula and then grabbed and dragged (or double clicked) that little box in the bottom right of the cell to have it repeat, the cells would change.

The little square down the bottom of the cell

This normally is great, because it moves by a cell each time and makes my life easier.

What if I want to keep a certain cell constant in a formula?

Enter the Absolute Reference.

The absolute reference allows you to lock either or both aspect of the cell. That is it can lock the column and/or the row. This is done by simply adding a “$” before the column or row. Here is how we do it:

  • $A$1 – locks both Column and Row
  • $A1 – locks only the Column
  • A$1 – locks only the Row

Awesome!!! Now you can drag that little square wherever you want and whatever part of that cell you locked wont change while everything else will.

F4 – The Shortcut From the Gods

So, this is all well and good, but it still means that after I have finished entering the whole formula, I have to go back into the cell and change the cell value with that dollar sign “$”.

F4 to the rescue. You can change the value live here by cycling through $A$1, $A1 and A$1 before continuing with your formula. While completing a formula simply,

  1. click a cell or range you want to get a value from and you want to lock or make an Absolute Reference.
  2. Press <F4> until you get the desired Absolute Reference combination.
  3. Continue with the rest of your formula.

Example – My Fruit Binge

I really love fruit (Okay, I’m ambivalent about fruit, but I am trying to sell the example here!)

I have a list of fruit that I have eaten in the last hour. My wife has caught me with a pile of cores and skins scattered around me and wants me to count how much this food binge cost me in order to make me feel bad.

Of course, I immediately run to my laptop and bring up my list of fruit I just ate. I can also remember how much each item costs (Yep, the example is breaking here, stay with me).

To work out the total costs of what I ate, I will count how many of each item and multiply that by the costs of each item.

Here is my Google Sheet so far:

Fruit Google Sheets


Lets plug in the formula to count the total number of Bananas.

Google Sheets Countif


Things look good so far. In cell G3 I have run countif and selected the range C2:C13. And I only want it to count if the cell contains the text “Banana” which I indicate by cell E3. Finally, in cell H3 I multiply the total number of times Banana appears (G3) by the cost of the item (F3).

The end results:

Google Sheets Fruit absolute reference error

Just for shits and giggles, lets see how that countif formula will work if I drag it down with that cheeky little box in the bottom right of the cell.

Fruit google sheets no absolute reference.

As you can see things have gone a bit Pear-shaped (nailed it!) here. We can see 2 pairs in the list in column C but the formula is only counting one in cell G7. 

Let’s take a look at the formula in G7.

countif reading wrong cells

We can see here that the range has changed from C2:C13 to C6:C17. That is not helpful at all. We need to make these into an Absolute Reference. The fruit criterion also moved, but we wanted it to come down to read Pear so that is pear-fict (Not so good that time).

Let’s fix this up. We need to change the countif range in cell G3 to an Absolute Reference from C2:C13 to $C$2:$C$13. This is kinda awkward so let’s try that <F4> shortcut out and put in the formula again fresh. To do this I did the following steps.

  1. entered:  =COUNTIF(
  2. selected the range C2:c13
  3. hit the magical <F4> button once and it created: $C$2:$C$13
  4. entered a comma:   ,
  5. selected the range E3
  6. closed the bracket: )
  7. hit <enter>Google Sheets Absolute reference with F4

Looks good. We’ll grab that little box down the bottom again and drag (or double click) it down and see if we get that extra pear.

Absolute reference in use

Boom! It worked. We now see 2 pears counted. Check out that bottom cell. It’s lock in the range value and only changes the fruit criterion.

Absolute reference view of final cell

Just to be pear-dantic (Hey! That was okay!) let’s see how guilty we should be for our fruit binge.

Fruit binge total google sheets

$38.10? Worth it!