Wednesday, July 17, 2013

Google Spreadsheet Latest non zero value

Question:

( by Robert Warner )


I have a table with dates and totals that need be filled in as data comes in (see table below: column A is date, B and C are inventory values at 2 different warehouses, so D is the sum of B and C). I'd like to pull the most recent total inventory value in a different cell (E1), that reads down column D and pulls the latest non-zero number, so as I update inventory next week, it will automatically the pull the most recent total inventory figure.

A               B     C      D
7/15/2013 134 158 292
7/22/2013 0 0 0
7/29/2013 0 0 0
8/5/2013 0 0 0
8/12/2013 0 0 0
8/19/2013 0 0 0
8/26/2013 0 0 0

Thanks in advance for your help!
Rob


Solution:

Have a look at the following screenshot of my spreadsheet:




I have the following formula in Cell E1:

=query(A:D;"select D where D>0 order by A desc limit 1")

the above formula will give you the latest non 0 value from Column D.


I hope the above solution will help you, and if you need more help then please do comment below on this blog itself, I will try to help you out.

I also take up private and confidential projects:
If this blog post was helpful to you, and if you think you want to help me too and make my this blog survive then please donate here: http://igoogledrive.blogspot.com/2012/09/donate.html 

Thanks,

1 comment: