Sunday, 5 April 2015

Things to remember - Google Sheets - how to show the last number in a column

I have a Google Sheets file that I put all the water information for our farm into. It's fairly comprehensive with formulas etc to let me know the following once I measure the water level from the top of the tanks:

  • volume of water remaining
  • amount used since the last recording date
  • average usage since last recording date
  • amount of rain we can have until the main collection tank overflows (so I know when to pump it up to the feeder tanks)
I would like a summary of the actual levels in each tank in a nice little chart that I can import into our personal intranet site hosted with Google Sites (this part is ridiculously easy), but I don't want to have to change the site information overtime I think about it. 

I found this:

=FILTER( A10:A100 , ROW(A10:A100) =MAX( FILTER( ArrayFormula(ROW(A10:A100)) , NOT(ISBLANK(A10:A100)))))
Now if you put that into a cell, alter the ranges to suit, it will give you the last number in the column (and maybe row, but I haven't tested that). It works very well - not only for numbers but for the dates as well. The little summary chart now shows:
  • The Date of last reading
  • amount of water remaining in each tank
  • amount of rain we can store until the collection tank overflows
And with Google Sheets adding in some decent conditional formatting I have it all colour coded and it looks a bit like this:


Not bad eh? The bit that tells me the overflow is elsewhere on the page. And yes, we're in pretty decent shape given that it's the start of Autumn and we should get rain soon!

No comments:

Post a Comment

Adventures with Immich

With the implementation of my Proxmox server it's now time to play with some new applications - and we'll start with Immich, a repla...