+ Reply to Thread
Results 1 to 7 of 7

How to create a Cumulative Total formula from varied data

Hybrid View

Addict How to create a Cumulative... 05-26-2012, 12:00 PM
xladept Re: How to create a... 05-26-2012, 04:22 PM
Addict Re: How to create a... 05-26-2012, 07:35 PM
FDibbins Re: How to create a... 05-26-2012, 04:34 PM
xladept Re: How to create a... 05-27-2012, 07:44 PM
Addict Re: How to create a... 05-29-2012, 04:33 AM
xladept Re: How to create a... 05-29-2012, 01:18 PM
  1. #1
    Registered User
    Join Date
    05-26-2012
    Location
    On the couch
    MS-Off Ver
    Excel 2007
    Posts
    3

    How to create a Cumulative Total formula from varied data

    I'm trying to make a cumulative total formula for a dial guage i have set up to measure displacement. The gauge only goes up to 50 so it has to be reset when it approaches that value, and sometimes it doesn't work properly and is reset earlier, or just reported as not working. I would like the cumulative total to equal the cumulative total of the last reading if no reading data is added and the instrument to be reset multiple times. The formula is for the cumulative total column. The data I have set up in the sheet as follows:

    Date	 Reading	Working? Reset?	Cumulative Total
    25/05/2012	2			0
    26/05/2012	4			2
    27/05/2012	14			12
    28/05/2012	27			25
    29/05/2012	25			23
    30/05/2012	37			35
    31/05/2012	40			38
    1/06/2012		No		38
    2/06/2012		No		38
    3/06/2012		broken		38
    4/06/2012	0		reset	38
    5/06/2012	2			40
    6/06/2012	6			44
    7/06/2012	23			61
    8/06/2012		No		61
    9/06/2012	23			61
    10/06/2012	35			73
    11/06/2012	5		YES	73
    12/06/2012	3			71
    13/06/2012	4			72
    14/06/2012	4			72
    15/06/2012		Nope		72
    Any help would be tremendously appreciated!
    Attached Files Attached Files
    Last edited by Addict; 05-26-2012 at 07:37 PM. Reason: Fixed error in data, and changed for non zero reset

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: How to create a Cumulative Total formula from varied data

    Hi Addict,

    If not having E11 blank works for you then this seems to do the trick:

    =IF(AND(B2>0,ISNUMBER(B1)),B2-B1+E1,IF(ISNUMBER(E1),E1,0))
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    05-26-2012
    Location
    On the couch
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to create a Cumulative Total formula from varied data

    Thanks so much xladept for your reply, E11 shouldn't have been blank, so the formula works! However, is there a way to tweak this formula so that if the device is not reset to zero the cumulative total will still continue, as the formula breaks down when this occurs?

    Date	 Reading	Working? Reset?	Cumulative Total
    25/05/2012	2			0
    26/05/2012	4			2
    27/05/2012	14			12
    28/05/2012	27			25
    29/05/2012	25			23
    30/05/2012	37			35
    31/05/2012	40			38
    1/06/2012		No		38
    2/06/2012		No		38
    3/06/2012		broken		38
    4/06/2012	0		reset	38
    5/06/2012	2			40
    6/06/2012	6			44
    7/06/2012	23			61
    8/06/2012		No		61
    9/06/2012	23			61
    10/06/2012	35			73
    11/06/2012	5		YES	73
    12/06/2012	3			71
    13/06/2012	4			72
    14/06/2012	4			72
    15/06/2012		Nope		72

    Thanks for your reply FDibbins, much appreciated however that formula doesn't seem to work as if no reading is entered the cumulative total becomes 0 and the device may be reset before reaching 50 for whatever reason.
    Attached Files Attached Files

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: How to create a Cumulative Total formula from varied data

    assuming your data starts in column A, with *** total in column E, try this formula in E3, copied down...

    =IF(ISTEXT(B3),E2,IF(E2+B3>=50,0,B3+E2))

    In E2, just use =B2
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: How to create a Cumulative Total formula from varied data

    Hi Addict,

    I tweaked it - hope it's what you want:

    =IF(AND(ISNUMBER(B2),ISNUMBER(B1)),IF(B2-B1>-10,B2-B1+E1,E1),IF(ISNUMBER(E1),E1,0))

  6. #6
    Registered User
    Join Date
    05-26-2012
    Location
    On the couch
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to create a Cumulative Total formula from varied data

    Awesome! Thanks xladept, works a treat.

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: How to create a Cumulative Total formula from varied data

    Hi Addict,

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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