+ Reply to Thread
Results 1 to 3 of 3

Calculting an average from time variance that has positive and negative numbers.

  1. #1
    Registered User
    Join Date
    05-13-2016
    Location
    Richmond, NY
    MS-Off Ver
    2010
    Posts
    16

    Calculting an average from time variance that has positive and negative numbers.

    Good day,
    I'm trying to get . In other words, the difference of Sched Up Time - Actual Up Time = Variance. Anything with a "+" is late and "-" is early. The problem is that excel takes those "+" and "-" as part of a formula or makes these numbers as text. I have to total up the Variance column to give an overall average for that week. Can this be done in Excel? I receive errors if I use average since it doesn't like those "+" or "-"'s.

    Date Sched Up Time Actual Up Time Variance Status
    6/18/2016 08:00 08:32 +00:32 Late
    6/20/2016 08:00 08:31 +00:31 Late
    6/21/2016 08:00 07:26 -00:34 Early
    6/22/2016 08:00 08:45 +00:45 Late
    6/23/2016 08:00 09:05 +01:05 Late
    6/24/2016 08:00 09:46 +01:46 Late

    Thanking you in advance.
    Attached Files Attached Files

  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,946

    Re: Calculting an average from time variance that has positive and negative numbers.

    There are no formulae in your attachment, just values.
    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
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Calculting an average from time variance that has positive and negative numbers.

    Quote Originally Posted by chelsea7A View Post
    the difference of Sched Up Time - Actual Up Time = Variance. Anything with a "+" is late and "-" is early. The problem is that excel takes those "+" and "-" as part of a formula or makes these numbers as text.
    How did you get the "+" and "-" signs, in the first place?

    It would be best to solve the problem at the source: the formulas that calculate column D ("variance"). Since Excel does not usually like negative time values (and enabling the 1904 date system is a bad idea, IMHO), it would be better to calculate "variance" in decimal minutes. For example:

    D2: =ROUND((C2-B2)*1440, 2)

    formatted as Custom +General;-General;0 . ROUND is used to eliminate anomalies that creep into binary arithmetic with decimal fractions, which is how Excel time is stored.

    Then the average is simply =AVERAGE(D2:D7), with the same Custom format.

    However, if the "variance" data is input as text, then array-enter the following formula (press ctrl+shift+Enter instead of just Enter):

    =AVERAGE(ROUND(MID(D2:D7,2,7)*IF(LEFT(D2:D7,1)="+",1440,-1440),0))

    In the Custom format, you can change General and 0 to 0.00 or any number of decimal places that you want.

+ 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] Finding average value for the positive and negative set of numbers
    By thilag in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-26-2014, 04:39 AM
  2. Sum of time for consecutive positive/ negative numbers
    By DexterG in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-25-2012, 04:03 AM
  3. Average formula with positive and negative numbers
    By lovebeingtan in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-29-2012, 08:28 PM
  4. Replies: 5
    Last Post: 11-17-2010, 09:03 PM
  5. Replies: 4
    Last Post: 07-08-2010, 09:33 AM
  6. 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
  7. Replies: 8
    Last Post: 02-22-2010, 03:45 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