+ Reply to Thread
Results 1 to 21 of 21

All time best figure

  1. #1
    Registered User
    Join Date
    08-22-2016
    Location
    Coventry, England
    MS-Off Ver
    2013
    Posts
    11

    All time best figure

    Hi all

    I have a sheet that records the production output from various machines that is automatically updated every 10 minutes. As well as displaying today's total I want to display the "all time" best total but I cant' seem to do this without creating a circular reference.

    e.g. Cell C4 contains today's total from one machine, I want E4 to be the "best ever" and I'm using G4 as a hidden cell for my initial best ever which I've just entered 1

    So, my best ever formula is =IF(C4>G4,C4,G4) so if today's is better that the previous best make the previous best = today's total. That's OK but how do I update G4 to be the best so far?

    Hope that makes sense....

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: All time best figure

    Welcome! It would be easier to advise if we could have a look at your set-up.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    08-22-2016
    Location
    Coventry, England
    MS-Off Ver
    2013
    Posts
    11

    Re: All time best figure

    Thank you Ali

    Here is a sample:
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: All time best figure

    I'm sorry, but your sample sheet needs to be standalone. At the moment it's referencing this: ='C:\Program Files (x86)\JetReports\JetReports.xlam'!NL("Count","Capacity Ledger Entry",,"No.","SAW","Posting Date",TODAY())

    So there's nothing I can do with it to troubleshoot your problem.

  5. #5
    Registered User
    Join Date
    08-22-2016
    Location
    Coventry, England
    MS-Off Ver
    2013
    Posts
    11

    Re: All time best figure

    Sorry, I forgot to paste values only. Try this:
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: All time best figure

    I'm sorry - I'm not making myself clear! We need a simplified version of your data with calculations also present.

  7. #7
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: All time best figure

    Unless I'm missing something isn't it just

    =MAX($B$4:B4) in D4 dragged down
    Attached Files Attached Files
    Happy with my advice? Click on the * reputation button below

  8. #8
    Registered User
    Join Date
    08-22-2016
    Location
    Coventry, England
    MS-Off Ver
    2013
    Posts
    11

    Re: All time best figure

    Hi again

    No, I don't want to see which individual stage has the maximum output of all, I want to see each stage's best-ever total individually.

    @ Ali, sorry I copied and pasted values and forgot the other formula... duh. Try again...
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: All time best figure

    This is how I think it should be.
    Attached Files Attached Files
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  10. #10
    Registered User
    Join Date
    08-22-2016
    Location
    Coventry, England
    MS-Off Ver
    2013
    Posts
    11

    Re: All time best figure

    Hi Willem

    Thank you. Is there a way that the update macro can be triggered without a user having to press a button? My intention is this will be an automated report that will run on a schedule. For example, can the macro be triggered if the workbook is closed thereby updating the best figure for the next time the workbook is opened?

  11. #11
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: All time best figure

    Try it this way
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    08-22-2016
    Location
    Coventry, England
    MS-Off Ver
    2013
    Posts
    11

    Re: All time best figure

    Hi Willhem. That seems to have broken the correct operation for me. As soon as I update a figure in the "today" column, the all-time best matches it but it no longer retains the highest value. If I enter 5 in today the highest goes to 5 but then if I enter 4 in today the highest also changes to 4 instead of remaining at 5. Thanks for your help so far

  13. #13
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: All time best figure

    If I enter 5 in today the highest goes to 5 but then if I enter 4 in today the highest also changes to 4
    'Last time best' best is updated when file is closed
    'All time best' is update if today is changed.

    The 5 is not updated if the file is not saved closed

  14. #14
    Registered User
    Join Date
    08-22-2016
    Location
    Coventry, England
    MS-Off Ver
    2013
    Posts
    11

    Re: All time best figure

    Ah, that makes perfect sense, thank you very much!!

    One last question (I'm far from an Excel expert) how do i get the macro from this sample and put it into my working workbook?

  15. #15
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: All time best figure

    Open VBA:

    Tab 'developer '
    'Visual Basic'

    or
    ALT F11

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: All time best figure

    I am still very confused by your sample data.

    Excel 2016 (Windows) 32 bit
    B
    C
    D
    E
    F
    G
    3
    Today
    All-time Best
    4
    STAGE 1
    4
    4
    0
    5
    STAGE 2
    3
    3
    0
    6
    STAGE 3
    2
    2
    0
    7
    STAGE 4
    2
    2
    0
    8
    STAGE 5
    0
    0
    0
    9
    STAGE 6
    3
    3
    0
    10
    STAGE 7
    0
    0
    0
    11
    STAGE 8
    0
    0
    0
    12
    STAGE 9
    10
    10
    0
    13
    STAGE 10
    1
    1
    0
    14
    STAGE 11
    0
    0
    0
    15
    STAGE 12
    0
    0
    0
    16
    STAGE 13
    0
    0
    0
    17
    STAGE 14
    0
    0
    0
    Sheet: Sheet1

    None of the values in columns C and E differ, and I have no understanding whatsoever of the need for column G, which is completely populated with zeroes. I am glad that somebody understands what you want, though.

  17. #17
    Registered User
    Join Date
    08-22-2016
    Location
    Coventry, England
    MS-Off Ver
    2013
    Posts
    11

    Re: All time best figure

    Thanks again! Hopefully this is the last question now.... Because it does the copying on close is there any way to automatically answer yest to the dialog "Do you want to save changes...."

  18. #18
    Registered User
    Join Date
    08-22-2016
    Location
    Coventry, England
    MS-Off Ver
    2013
    Posts
    11

    Re: All time best figure

    At the moment on the first day of running the all time best is what has happened today, so C & E are the same. Tomorrow though say STAGE1 made 6 and STAGE2 made 1. I would want column E, the all time best, to show 6 for STAGE1 (new new all-time high) but for STAGE2 column E would remain at 3 because todays output (1) does not break the all time high record.

  19. #19
    Registered User
    Join Date
    08-22-2016
    Location
    Coventry, England
    MS-Off Ver
    2013
    Posts
    11

    Re: All time best figure

    Quote Originally Posted by AliGW View Post
    I am still very confused by your sample data.

    Excel 2016 (Windows) 32 bit
    B
    C
    D
    E
    F
    G
    3
    Today
    All-time Best
    4
    STAGE 1
    4
    4
    0
    5
    STAGE 2
    3
    3
    0
    6
    STAGE 3
    2
    2
    0
    7
    STAGE 4
    2
    2
    0
    8
    STAGE 5
    0
    0
    0
    9
    STAGE 6
    3
    3
    0
    10
    STAGE 7
    0
    0
    0
    11
    STAGE 8
    0
    0
    0
    12
    STAGE 9
    10
    10
    0
    13
    STAGE 10
    1
    1
    0
    14
    STAGE 11
    0
    0
    0
    15
    STAGE 12
    0
    0
    0
    16
    STAGE 13
    0
    0
    0
    17
    STAGE 14
    0
    0
    0
    Sheet: Sheet1

    None of the values in columns C and E differ, and I have no understanding whatsoever of the need for column G, which is completely populated with zeroes. I am glad that somebody understands what you want, though.

    At the moment on the first day of running the all time best is what has happened today, so C & E are the same. Tomorrow though say STAGE1 made 6 and STAGE2 made 1. I would want column E, the all time best, to show 6 for STAGE1 (new new all-time high) but for STAGE2 column E would remain at 3 because todays output (1) does not break the all time high record.

  20. #20
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: All time best figure

    OK. I think you have your answer with the macro that has been provided, but for future reference, it is this level of detail that is required in a sample sheet so that we can see exactly what you are trying to achieve. Thanks for the explanation.

  21. #21
    Registered User
    Join Date
    08-22-2016
    Location
    Coventry, England
    MS-Off Ver
    2013
    Posts
    11

    Re: All time best figure

    Thank you all for the 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. [SOLVED] I can't figure out why I am receiving a run time error '91'?
    By redsab in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-11-2014, 05:29 PM
  2. Replies: 4
    Last Post: 02-03-2014, 08:05 AM
  3. HELP! Trying to figure out how to calculate time?
    By lespice in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-18-2013, 01:06 PM
  4. Converting a figure into Time
    By The Billionaire in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-17-2013, 03:23 PM
  5. [SOLVED] Need Macro to figure out time
    By Dnakr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-31-2013, 05:09 PM
  6. I am trying to figure out how to subtract time.
    By childers2 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-03-2012, 03:29 PM
  7. [SOLVED] format a six figure number to a time.
    By Ade in forum Excel General
    Replies: 7
    Last Post: 01-21-2006, 02:55 PM

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