Skip to content

Instantly share code, notes, and snippets.

@sogrady
Created November 19, 2025 00:11
Show Gist options
  • Select an option

  • Save sogrady/b460c15a545ab2cc2724aff74f4492bb to your computer and use it in GitHub Desktop.

Select an option

Save sogrady/b460c15a545ab2cc2724aff74f4492bb to your computer and use it in GitHub Desktop.
Google Sheets Formulae for Calculating Hourly Usage from CMP CSV Exports
## Generate List of Months
=SORT(UNIQUE(ARRAYFORMULA(LEFT(G2:G9999,7))))
## Sum Peak Usage
=SUMPRODUCT((LEFT(G$2:G$9999,7)=K2)*((MID(G$2:G$9999,12,2)="17")+(MID(G$2:G$9999,12,2)="18")+(MID(G$2:G$9999,12,2)="19")+(MID(G$2:G$9999,12,2)="20"))*I$2:I$9999)
## Sum Non-Peak Usage
=SUMPRODUCT((LEFT(G$2:G$9999,7)=K2)*I$2:I$9999)-L2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment