+ Reply to Thread
Results 1 to 8 of 8

how to compute percentage of time looking at corresponding values in columns

Hybrid View

  1. #1
    Registered User
    Join Date
    12-16-2009
    Location
    Germany
    MS-Off Ver
    Excel 2003
    Posts
    4

    Exclamation how to compute percentage of time looking at corresponding values in columns

    Dear all,

    I am new to excel and have a doubt in a particular computation. I would highly appreciate your help in this regard.

    1. Imagine 2 columns; A(having time displayed hh:mm:ss:ms format) & B (a value corresponding to time).
    2. Assume only 2 possible values for column B e.g. Val1 or Val2
    3. I would like to compute the percentage of time for which Val1 was in use & the same for Val2.

    Any ideas how this could be done? Please suggest me some possible ways of getting this done.

    Thanking you in advance,
    Andy13

    Added an excel sample to show the example. I hope this clears the issue little better.
    Attached Files Attached Files
    Last edited by andy13; 12-16-2009 at 09:02 AM. Reason: added attachment to elaborate example

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: how to compute percentage of time looking at corresponding values in columns

    It would be best if you uploaded a sample workbook with some data. It's not clear what you mean by " & B (a value corresponding to time)". If possible, manually show the expected result you need
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    12-16-2009
    Location
    Germany
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: how to compute percentage of time looking at corresponding values in columns

    Hi Palmetto,

    i appended a sample to the original post.
    Your inputs would be of great help.

    regards,
    andy13

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: how to compute percentage of time looking at corresponding values in columns

    You'll need an array function (CTRL, SHIFT and ENTER) such as this one:

    =MAX(IF(B2:B14="Val2",A2:A14))-MIN(IF(B2:B14="Val2",A2:A14))+1

    to give the actual time at Val 2

    However, this won't work on your data, as excel doesn't recognise the time format you're are using. It will need to be converted to a format excel can read as a number.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: how to compute percentage of time looking at corresponding values in columns

    If as per your sample you have a record per ms then Val2 time equates to:

    =COUNTIF(B:B,"Val2")*"0:0:0.001"
    format to s.000
    If you just want the percentage you can ignore the Time conversion and just use:

    =COUNTIF(B:B,"Val2")/(COUNTA(A:A)-COUNTA(A1))
    format to %

  6. #6
    Registered User
    Join Date
    12-16-2009
    Location
    Germany
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: how to compute percentage of time looking at corresponding values in columns

    Thanks Sweep

    I tried with simple incrementing int values instead of hh:mm:ss:ms format and it works as expected.

    However regarding the time format i have - what should be the best format to use so the precision is not lost. Also how can I change this format to something excel readable?

    appreciate your help,
    Anand

  7. #7
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: how to compute percentage of time looking at corresponding values in columns

    Good question - excel would most "like" hh:mm:ss.000 - is it possible to get the software that generates the data to output in this format?

    Dave

  8. #8
    Registered User
    Join Date
    12-16-2009
    Location
    Germany
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: how to compute percentage of time looking at corresponding values in columns

    Hi guys,

    i tried the format and formulas you suggested.
    But it doesnt work out fine if the changes are in hours!
    My data is expected to change over entire range of hh:mm:ss:ms

    Any ideas?

    thanks a lot for all your time and help,
    Andy13

+ 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