Short answer
Besides the use of other functions, like YEARFRAC() as was suggested by Live Forever, usually the way to get the shorter formula is to use a custom function.
Example
A Custom function
/**
* Calculates the progress of the year for the date provided.
*
* @param {DATE(2015,1,1)} input - The date to calculate the progress of the year.
* @customfunction
*/
function YEARPROGRESS(adate) {
if(adate instanceof Date){
var start = new Date(adate.getFullYear(), 0, 0);
var day = Math.floor(adate - start);
var end = new Date(adate.getFullYear(), 11, 31)
var days = Math.floor(end - start);
return day/days;
} else {
throw new Error('adate should be a valid date' );
}
}
Use examples
=YEARPROGRESS(A1)
=YEARPROGRESS(DATE(2015,1,1))
Use the cell formatting options to display the result as percentage.
Custom function names
If you want to save even more characters, you could name your function as short as a single alphabetic character (A..Z) but this is not a good practice as this could make a bit harder to remember how was named.
From the reference
Naming
In addition to the standard conventions for naming JavaScript
functions, be aware of the following:
- The name of a custom function must be distinct from the names of
built-in functions like SUM().
- The name of a custom function cannot end with an underscore (_), which denotes a private function in Apps Script.
- The name of a custom function must be declared with the syntax
function myFunction(), not var myFunction = new Function().
- Capitalization does not matter, although the names of spreadsheet
functions are traditionally uppercase.
References