Date-based functions in Google Docs

From Visual Basic to GNU C, this is the place to talk programming.

Moderators: SecretSquirrel, just brew it!

Date-based functions in Google Docs

Postposted on Mon Sep 05, 2011 7:49 pm

I have a spreadsheet in Google Docs that contains a list of students and the number of reward cards they each get. The school year is broken into quarters and I want to tally how many cards each student got in each of them. I feel like I want to make a conditional formula that says if the date is between so and so values, increment this cell's value by one every time cell X is incremented. This might be too difficult to be worth it, but I'm curious if it can be done. Any help is greatly appreciated!
Sheep Rustlers in the sky! <S> Slapt | <S> FUI | Air Warrior II/III
FireGryphon
Darth Gerbil
Gold subscriber
 
 
Posts: 7341
Joined: Sat Apr 24, 2004 7:53 pm
Location: the abyss into which you gaze

Re: Date-based functions in Google Docs

Postposted on Fri Sep 16, 2011 5:18 am

I'm no expert but you should be able to write a script to do the job. Docs scripts are written in javascript so are very easy to jump into if you already do a bit of web programming.

IIRC you can either make the script run when the sheet is opened or add a menu for the scripts functions to the main menu bar. I don't think there's a way to make the script automatically run when you update cells so it's not quite the same thing as a conditional formula.

The best way to get started is to have a play with the script gallery, there are plenty of examples to look at.

As I understand it you do run into issues when sharing a sheet that relies on scripts as the script isn't automatically shared. Don't quote me on this though... stuff changes very quickly on google apps and I don't really keep up with it.
Fernando!
Your mother ate my dog!
cheesyking
Minister of Gerbil Affairs
 
Posts: 2263
Joined: Sun Jan 25, 2004 7:52 am
Location: That London (or so I'm told)


Return to Developer's Den

Who is online

Users browsing this forum: No registered users and 2 guests