+ Reply to Thread
Results 1 to 23 of 23

A Cumulative formula is needed for tracking positive and negative times for a flexi balanc

  1. #1
    Registered User
    Join Date
    11-07-2023
    Location
    London
    MS-Off Ver
    Office 2016
    Posts
    12

    A Cumulative formula is needed for tracking positive and negative times for a flexi balanc

    Hello

    First time poster. I have been scouring the Internet and this website for a solution but I haven't found one yet.

    I have a column in Excel containing positive and negative values in the format of hours and minutes. It's a formula that calculates if more or less than 7 hours have been worked in a day.

    The starting flexi balance for a month is zero hours and zero minutes, displayed as 0:00. A full day's work is 7 hours.

    Let's say on day one I work 6:45, it would result in the flexible balance showing as negative 15 minutes, -0:15. And if I worked an extra half hour on the 2nd day it should show a new flexi balance of 15 minutes in the format of 00:15.

    I am struggling to create a Cumulative formula that can change to either a positive or negative value, without just showing ### when the value is a negative.

    I am already aware of using the 1904 date system but that isn't an option.

    Any help would be greatly appreciated.

    Thanks

    Billy
    Attached Files Attached Files
    Last edited by Billybifocals; 11-09-2023 at 03:44 PM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: A Cumulative formula is needed for tracking positive and negative times for a flexi ba

    Are you really still using Excel 2007??

    Your sample is incomplete, as you haven't calculated hours worked and compared them with a standard day. You just start by adding a negative time. That won't work.

    Take a look at this file.

    The flexi-time column is TEXT that looks correct. The total at the foot of the data therefore has to convert text back into numbers.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    11-07-2023
    Location
    London
    MS-Off Ver
    Office 2016
    Posts
    12
    Sorry, no I'm not using the 2007 version of Excel, my company is using the most recent version of it.

    And that excel file is just an extremely basic example of what I'm trying to achieve. I had to create it on my mobile phone. This forum forces people to upload a spreadsheet just to ask for help. When I downloaded that spreadsheet it hasn't saved it correctly either. The negative values shouldn't be showing as decimals, they were saved as negative hours and minutes.

    I know Excel can't cope with negative hours and minutes values.

    Please disregard how the spreadsheet is calculating that daily positive or negative value, i don't have an issue with that formula and it's working fine in the spreadsheet saved on my work pc.

    I just need a formula to keep a running total of accrued flexible working hours, by looking at previous values and either adding or subtracting amounts from it, in order to keep a running flexi Balance.

    The closest formula I have got to this is using productsum but that still results in hashes when the flexi Balance is in a negative.

    Thanks

  4. #4
    Registered User
    Join Date
    11-07-2023
    Location
    London
    MS-Off Ver
    Office 2016
    Posts
    12

    Re: A Cumulative formula is needed for tracking positive and negative times for a flexi ba

    Thank you for the spreadsheet, that is very helpful. I will try that when I am back in the office to see if that works with the data I am using.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: A Cumulative formula is needed for tracking positive and negative times for a flexi ba

    If you want solutions for O365, then amend your profile to show O365...

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: A Cumulative formula is needed for tracking positive and negative times for a flexi ba

    Actually, the forum does NOT force you to upload anything. However, a sample sheet makes it much easier to follow what you want. Words are often VERY ambiguous.

    My view is that because we do this for fun... and because you want free help... we expect YOU to put in a bit of effort to help us to help you. Often that means the provision of a >>>representative<<< sample sheet.

  7. #7
    Registered User
    Join Date
    11-07-2023
    Location
    London
    MS-Off Ver
    Office 2016
    Posts
    12
    Is there any reason why you're being so unnecessarily aggressive with me?

    This forum only allowed my initial post to go live after I attached a spreadsheet. Every time prior to attaching a spreadsheet it immediately wiped everything in the post and just kept the subject.

    I don't WANT anything from anyone. I was simply asking for advice from people experienced with excel formulas. I wasn't demanding anything from anyone.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: A Cumulative formula is needed for tracking positive and negative times for a flexi ba

    1. I do not consider my reply at all aggressive.

    2. The forum platform is elderly and a bit flakey. Sometimes (all too often) things go wrong. However, there is absolutely no mandatory requirement for attachments to be uploaded.

    3. I do not see the word "demand" in my previous reply. Where did you see it?

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: A Cumulative formula is needed for tracking positive and negative times for a flexi ba

    Thank you for your complaints and negative reputation.

    i hope the help offered at Post 2 worked for you.

  10. #10
    Registered User
    Join Date
    11-07-2023
    Location
    London
    MS-Off Ver
    Office 2016
    Posts
    12

    Re: A Cumulative formula is needed for tracking positive and negative times for a flexi ba

    I don't even know how you expect me to respond to your sarcasm? In my job, If I spoke to people the same condescending way you do to complete strangers, I'd end up getting a disciplinary. I'm assuming you're either your own boss so you just talk to people as you like or you just work in an IT environment away from human interaction. I can appreciate you probably spend 24/7 on here so all your spare time is wasted interacting with imbeciles like me right? People that don't have decades of Excel experience. I don't have Excel experience so I'm just a waste of oxygen compared to you.

    No that solution you provided didn't work unfortunately. It still shows positive values rather than negatives. I will just need to wait for someone else with more free time to respond instead.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,643

    Re: A Cumulative formula is needed for tracking positive and negative times for a flexi ba

    Can you confirm which version of Excel you are now using?
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  12. #12
    Registered User
    Join Date
    11-07-2023
    Location
    London
    MS-Off Ver
    Office 2016
    Posts
    12

    Re: A Cumulative formula is needed for tracking positive and negative times for a flexi ba

    Hello

    It appears to be Excel 2016 according to the icon to launch the application. I unfortunately can't find an about section in Excel to see any useful version information. Thank you.

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,643

    Re: A Cumulative formula is needed for tracking positive and negative times for a flexi ba

    It's in your profile - could you please update this to Excel 2016 (and not show 2013)?

    I am going to need a more detailed workbook, please. I think you are saying that the values come from a formula - is this correct? Also you talk about a starting balance, but I don't see this anywhere. I'd like to see a bit of wider context in order to be able to give the best advice. Does this make sense?

  14. #14
    Registered User
    Join Date
    11-07-2023
    Location
    London
    MS-Off Ver
    Office 2016
    Posts
    12

    Re: A Cumulative formula is needed for tracking positive and negative times for a flexi ba

    Hello

    Sorry for the confusion, my work environment is awful and has folders that show MS Office 2013 as well as MS office 2016, so I must be using office 2016.

    Yes what you have said makes sense. I will need to try to create another spreadsheet and upload it for you so my request makes more sense. I unfortunately can't send the spreadsheet outside of my organisation due to GDPR.

    What I am trying to achieve is a spreadsheet that can keep a running total of accrued flexible working hours. The running total needs be able to show negative values as well as positive values.

    The starting flexi Balance for a month is displayed as 00:00. A full day's required work is 7 hours, displayed in a seperate cell as 7:00.
    If on the first day I work 6 hours, I would expect the flexi Balance tracking cell to show as negative 1 hour, "-01:00", and if I was to work an extra 2 hours the following day, I would expect the flexi tracker cell on the row beneath to show as "01:00".

    Hopefully the above makes sense.

    Thank you.
    Last edited by Billybifocals; 11-08-2023 at 08:09 AM.

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,643

    Re: A Cumulative formula is needed for tracking positive and negative times for a flexi ba

    Great - I'll wait for the more detailed (but desensitised) sample workbook with the formulae that you are using in place. I understand the requirement, I just need more detailed data to work with. Please don't forget to add a MANUALLY calculated column showing your expected results. Thanks.

  16. #16
    Registered User
    Join Date
    11-07-2023
    Location
    London
    MS-Off Ver
    Office 2016
    Posts
    12
    Sorry about the delay. I had to make the spreadsheet on my phone, what would have taken me 2 minutes has taken me almost 40. I can't set the cell formatting on the phone version of "sheets", all the values are supposed to be in hh:mm, not decimals.
    Attached Files Attached Files

  17. #17
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: A Cumulative formula is needed for tracking positive and negative times for a flexi ba

    Named Range ("Daily") - CTRL-F3 to view/edit
    =SUM(IFERROR(TIMEVALUE(Sheet1!$L$7:$L7),0))-SUM(IF(LEFT(Sheet1!$L$7:$L7,1)="-",SUBSTITUTE(Sheet1!$L$7:$L7,"-","")+0,0))


    L7:
    =IF(I7="","",IF(I7>J7,TEXT(SUM(I7-J7),"-[hh]:mm:ss"),TEXT(SUM(J7-I7),"[hh]:mm:ss")))


    M7:
    =IF(Daily<0,TEXT(ABS(Daily),"-[hh]:mm:ss"),TEXT(Daily,"[hh]:mm:ss"))

    The formula in M7 >>may<< be an array formula in your older Excel product. If it appears in the file inside a set of {} it needs to be set with CTRL-SHIFT-ENTER in M7, before dragging down. It might be OK as is... I just can't remember if Named Ranges are calculated as arrays in older Excel products.
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    11-07-2023
    Location
    London
    MS-Off Ver
    Office 2016
    Posts
    12
    Thank you for that.

    The named range formula will need to be amended however as the name of the working tab needs to change each month, so the current tab I am working with is named "November 2023", future months will use the same naming format. The tabs are only created after the previous month has ended.

    Is there any way to amend the formula so that it applies to all workbooks rather than a particular one?

    Thankyou
    Last edited by Billybifocals; 11-09-2023 at 08:15 AM.

  19. #19
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: A Cumulative formula is needed for tracking positive and negative times for a flexi ba

    I won't be able to do anything further until tomorrow pm. I'm on my way to Dublin for a concert and have no PC with me.

  20. #20
    Registered User
    Join Date
    11-07-2023
    Location
    London
    MS-Off Ver
    Office 2016
    Posts
    12
    No problem, thank you for your help

  21. #21
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: A Cumulative formula is needed for tracking positive and negative times for a flexi ba

    One thought you can try...

    Copy the named range formula (minus the =) and paste it into the formula in M7 at every place where Daily is present. It'll be a bit of a monster, but will be more easily applicable on multiple sheets.

  22. #22
    Registered User
    Join Date
    11-07-2023
    Location
    London
    MS-Off Ver
    Office 2016
    Posts
    12
    Ok thanks I'll definately try that.

  23. #23
    Registered User
    Join Date
    11-07-2023
    Location
    London
    MS-Off Ver
    Office 2016
    Posts
    12

    Re: A Cumulative formula is needed for tracking positive and negative times for a flexi ba

    After a few hours of rebuilding my works master spreadsheet and using those formulas you suggested I did eventually get it working.

    The cumulative formula didn't like me placing the named range formula in it where 'Daily' was but after I created a seperate column just for the range formula the running flexible working balance formula started to work correctly.

    For all the columns, I did need to use the CTRL-SHIFT-ENTER option to copy and paste the formulas to the bottom of the spreadsheet.

    Hopefully this will help others facing the same issues.

    I can't believe how unnecessarily difficult Excel makes managing negative time values.
    Last edited by Billybifocals; 11-09-2023 at 04:14 PM.

+ 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] Averaging Positive and Negative Times
    By kitttieluv in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-27-2017, 08:44 PM
  2. Formula help needed please / positive vs negative results
    By SJR527 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-10-2015, 07:47 AM
  3. Replies: 2
    Last Post: 08-10-2015, 04:04 PM
  4. SUM negative and positive times - formulas fix
    By Lukael in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-21-2014, 09:33 AM
  5. Convert negative to positive in sheet containing both positive/negative numbers
    By sa02000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-29-2010, 07:52 PM
  6. Replies: 4
    Last Post: 09-26-2005, 06:05 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