+ Reply to Thread
Results 1 to 6 of 6

Column of incrementing values, find difference.

Hybrid View

  1. #1
    Registered User
    Join Date
    12-08-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    11

    Column of incrementing values, find difference.

    I have a column of incrementing values (electricity meter readings for each day).

    For example:

    Day 1 - 0001234
    Day 2 - 0001899
    Day 3 - 0001911
    Day 4 - 0002321
    Day 5 - 0002391

    Every month the spread sheet is renewed, and when I have a full 28, 30 or 31 days of readings, I can take the last reading and subtract the first reading to find the units consumed in the month.

    However, I would like to be able to look at the spreadsheet part way through a month and find the total used (as this then fires through some further calcs in the spreadsheet).

    Is there a way to look at entry Day 31 in the column, and if it is empty, look at Day 30, if this is empty, look at Day 29 and so on until it finds a value, and then use this, subtracted from the Day 1 figure to find the usage upto the last recording figure?

    I think I could use IF commands to achieve this, but it would be intensive! Is there any easier way to this?

    Thanks.

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Column of incrementing values, find difference.

    If your range of cells is A1:A31, you can try this:

    =INDEX(A1:A31,MAX(MATCH(9999999999,A1:A31)))-$A$1

    - Moo

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Column of incrementing values, find difference.

    try either of these depends if numbers are real numbers or text
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Registered User
    Join Date
    12-08-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Column of incrementing values, find difference.

    Thanks!

    Didn't expect a response so quickly to be honest, let alone two, and both perfect working examples!

    I have used the LOOKUP method, using numbers rather than text, but allowing leading zeros in the formatting.

    Is there away to change the #N/A errors throughout the calculations with a zero instead? Mainly for neatness!

    I have attached what I have so far, some of the calcs may appear a little confusing, but it is the columns I am totalling from row 5 to 35, the totals in row 37.

    Advice greatly recieved!

    Thanks a lot.

    File: Metering.xlsx

  5. #5
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Column of incrementing values, find difference.

    Since you're using the LOOKUP formula proposed by Martin, just wrap it in an IFERROR statement:

    =IFERROR(LOOKUP(99^99,B5:B35,B5:B35)-B5,0)

    - Moo
    Last edited by Moo the Dog; 12-08-2012 at 03:29 PM. Reason: Changed because OP asked for 0, instead of ""

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Column of incrementing values, find difference.

    just remembered second range not necessary
    =IFERROR(LOOKUP(99^99,B5:B35)-B5,0) will do

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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