+ Reply to Thread
Results 1 to 5 of 5

Formaula to calculate the downtime monthwise

  1. #1
    Registered User
    Join Date
    04-05-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    59

    Formaula to calculate the downtime monthwise

    Hello Friends/Sirs
    I am seeking help on an excel sheet as attached herewith, “Data” is source file where all the data is present.
    In “Monthwise downtime” sheet I want to calculate the downtime monthwise between two date ie. Under column C & J.
    I have calculated the downtime but it is all going into July Month as I considered Start date as reference to calculate the monhwise downtime.
    Please can anyone to solve my problem.

    Thanks & Regards
    Nitin
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Formaula to calculate the downtime monthwise

    I think that part of the issue is that some of your "dates" aren't actually dates at all, but strings that look like dates. You may have to translate them using a formula like =IF(ISNUMBER(C2),C1,DATEVALUE(C2)).
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    04-05-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: Formaula to calculate the downtime monthwise

    Thanks Sir ,

    Assuming the datevalues in proper date/time format i want to calculate the difference between two date and the results in respective months
    example
    suppose start date is 03rd feb-2015 and end date is 26-may2015 so i want the no. of mins or hours to be counted between these two dates and it should fall in feb, march, april, and may months. which would be 28feb minus 03rd feb , 31 days of march , 30 days of april, and 1st may to 26th may...

    Please can you help.

    very much thanks in advance

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Formaula to calculate the downtime monthwise

    The attached will outline the logic. You may have to change things to suit your particular needs.

    The first thing I did was convert the data into an Excel Table. I am taking advantage of two of the things tables provide:
    1. You can use column headers in formulas instead of ranges. This makes the formulas easier to read.
    2. Tables know how many rows they have. So you do not have to include the entire column or guess at how many rows to include

    To get more information on how to work with Excel Tables, see this article: http://www.utteraccess.com/wiki/inde...ables_in_Excel.

    Here are some other modifications I added:

    You need a place to specify the start date and the end date. I set these up in Cells B1 and B2 on the Monthwise downtime sheet. I also gave them a name. To give a name to a cell, put the cursor in the cell and go to the upper left where the cell address is shown. Then type in the name and press Enter. I gave these two cells the names: Start_Date and End_Date respectively.

    I also added a helper column to the data called In Range. The formula is =AND([@[Issue Reported Date/Time]]>=Start_Date,[@[Issue Reported Date/Time]]<=End_Date). This formula is True if the date is within range and false if the date is out of range.

    Now to the logic. Each cell in the equipment downtime area (Cells B6:E34) is subject to 3 criteria:
    1. It must match the month and year of the header row (Row 5).
    2. It must be between the start date and the end date.
    3. It must match the equipment alias name.

    I decided to use SUMPRODUCT instead of SUMIFS mainly because it's easier to use formulas like MONTH() and it is easier to use inequalities.

    So this part of the formula:
    (MONTH(Table_Data[Issue Reported Date/Time]) = MONTH(B$5)) * (YEAR(Table_Data[Issue Reported Date/Time]) = YEAR(B$5))
    assures that the value we are looking for is the same month and year as the header.

    This part of the formula:
    (Table_Data[In Range] = TRUE)
    assures that the date is within range.

    The combination of these two parts takes care of requirement that the start date and end date may be in the middle of the month instead of at the beginning and end of the month and yet accounts for full months in between.

    The final part of the formula is:
    (Table_Data[Equipment Alias Name]=$A6)
    assures that the calculated value is for the specific piece of equipment.

    To get a better idea of how SUMPRODUCT works, see this article: http://www.utteraccess.com/wiki/inde...Array_Formulas. SUMPRODUCT is not an array formula (so you do not have to press CTRL-SHIFT-ENTER), but it acts like one.

    Some of the other things I noticed was that you had some zeros in Column A. You may want to wrap the formulas in an if statement if special handling is required for these values.

    Hopefully, this should get you started.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-05-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: Formaula to calculate the downtime monthwise

    thank you sir this what was required to be done.

    Thanks again..!!

+ 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] calculate downtime on a running timesheet
    By sunflowersherri in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-08-2016, 09:59 PM
  2. Formaula needed to Calculate orevious month revenue by name and date range
    By Chykat2000 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-23-2015, 08:37 AM
  3. [SOLVED] Trying to calculate count of certain text values for different dates monthwise
    By Nitinkumar in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-17-2015, 08:02 AM
  4. How to calculate total bags in monthwise
    By Shilpa kanchan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-06-2013, 06:48 AM
  5. formaula problem
    By lsapp289 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-12-2013, 03:07 AM
  6. Calculate downtime between two dates exclude weekends
    By annice in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-09-2012, 07:19 AM
  7. [SOLVED] Formaula to multiply and add
    By Frank Malone in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-05-2006, 05:55 AM

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