+ Reply to Thread
Results 1 to 5 of 5

Usage since last reading formula

  1. #1
    Registered User
    Join Date
    10-30-2018
    Location
    Adelaide, Australia
    MS-Off Ver
    Online, 2010, 365
    Posts
    3

    Usage since last reading formula

    Hi,

    Problem Context: I'm creating an app in MS PowerApps to record and view meter readings (eg. Electricity, Water). I'm using an Excel Online workbook as the data source.


    Issue: Users will input readings but it is highly beneficial to calculate the usage since the last reading and display it at various points within the app. I'm not sure how to go about calculating this in the Excel workbook.

    I've attached an example workbook and highlighted the usage column in the readings table. I've also included an image from an app that is similar to what I'm trying to do.


    Please note that there are multiple meters within the readings table and the dates of readings are not necessarily consistent.

    Let me know if you need more info and thanks in advance!
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by winnie_the_bish; 10-30-2018 at 09:14 PM.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,938

    Re: Usage since last reading formula

    Take a look at the Excel function FORECAST, used like

    =FORECAST(TODAY(),UsageValues,DateValues)

    Like so:

    =FORECAST(TODAY(),B:B,A:A)

    That will use a linear extrapolation based for today's date based on historical usage.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    10-30-2018
    Location
    Adelaide, Australia
    MS-Off Ver
    Online, 2010, 365
    Posts
    3

    Re: Usage since last reading formula

    Hi Bernie, thanks for your help.

    Unfortunately I didn't word my question well. I want to calculate the actual usage between each reading.

    So if I have a reading of 23 for 'Meter A' on the 2/3/18 and then have a reading of 32 for 'Meter A' on the 4/3/18 (2 days later) I should get a usage of 9 attributed to the 4/3/18 record. In other words I used 9 units between each reading.


    Meter Reading Date Usage
    A 0 1/3/18 0
    A 23 2/3/18 23
    B 0 3/3/18 0
    A 32 4/3/18 9
    B 15 4/3/18 15
    B 76 7/3/18 61
    A 70 8/3/18 38
    Last edited by winnie_the_bish; 10-30-2018 at 06:49 PM.

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,938

    Re: Usage since last reading formula

    In D2, array-enter (enter using Ctrl-Shift-Enter) the formula (Note: I don't know if the app you are using supports array formulas - only one way to find out )

    =IF(COUNTIF($A$1:A2,A2)=1,B2,B2-MAX(IF($A$1:A1=A2,$B$1:B1)))

    and copy down to match your values in your table.

    This assumes that the readings are always greater as time goes on - if they can reset, then we will need another check.

  5. #5
    Registered User
    Join Date
    10-30-2018
    Location
    Adelaide, Australia
    MS-Off Ver
    Online, 2010, 365
    Posts
    3

    Re: Usage since last reading formula

    Thank you Bernie!

    This formula works brilliantly.


    I've just now realised that MS PowerApps doesn't read fields with formulas

    It looks like I'll have to find another way to do this, I might be able to replicate this formula in PowerApps.

    I'll mark as solved though, thanks again for your help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Please Help with formula usage per month use if statements in one formula?
    By rmschott in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-30-2017, 10:33 AM
  2. Usage of IR formula
    By gonefishing83 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-24-2016, 06:12 AM
  3. Workbook usage or Database usage assistance
    By Sunshine601 in forum Excel General
    Replies: 4
    Last Post: 12-12-2013, 08:36 AM
  4. Countif formula usage
    By newbie1234 in forum Excel General
    Replies: 12
    Last Post: 02-07-2012, 11:00 PM
  5. Need HELP with conditional usage formula
    By anthonyjf in forum Excel General
    Replies: 2
    Last Post: 08-02-2007, 05:49 AM
  6. Usage of SUMIF formula in the VBA code
    By GreenInIowa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-02-2005, 06:20 PM
  7. Usage of SUMIF formula in the VBA code
    By GreenInIowa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-02-2005, 06:17 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1