+ Reply to Thread
Results 1 to 11 of 11

SOLVED - formula that will calculate a metric (on time delivery) with criteria

  1. #1
    Registered User
    Join Date
    04-23-2021
    Location
    United States
    MS-Off Ver
    Office 365 Pro Plus
    Posts
    7

    Cool SOLVED - formula that will calculate a metric (on time delivery) with criteria

    Hey,

    I am trying to create a formula that will calculate a metric (on time delivery). I want the formula to count cells based upon some criteria. The criteria is if the date received is greater than 2 or less than -5 of the ETA and within the last 30 days of the received date in the "RCVD date" area.

    I was able to create a sumifs formula that almost did what I wanted but it was summing all of the days late column when I just need it to be counted.
    Attached Files Attached Files
    Last edited by excellerator02; 05-10-2021 at 10:29 AM.

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Looking for a sumifs or countifs formula I think

    Are you looking for 75%?
    Why and how your desired result come? Explain and we will help you to produce a formula.
    Quang PT

  3. #3
    Registered User
    Join Date
    04-23-2021
    Location
    United States
    MS-Off Ver
    Office 365 Pro Plus
    Posts
    7
    Yes the correct answer on the sample sheet is 75%.

    Why: I want to know what percent of deliveries are being delivered within a specific time window. The sample is just a few lines but we typically have 6-900 lines on a job.

    How: If a delivery is outside a window (5 days early to 2 days late) within the last month I want that line to be counted. I also want the output to be a percentage of total lines that were delivered within the last month. Ex 10 deliveries within last 30 days and 5 were on time. Should produce 50%
    Last edited by AliGW; 04-24-2021 at 09:54 AM. Reason: PLEASE don't quote unnecessarily!

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

    Re: formula that will calculate a metric (on time delivery) with criteria

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. As you are new, I have done it for you today.)
    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.

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: formula that will calculate a metric (on time delivery) with criteria

    In this sample, how 75% be calculated? is it 3 rows/4 rows?
    what are the 3 rows and 4 rows?
    And what is last month? from 30-Apr (cell E1) or from today's date?

  6. #6
    Registered User
    Join Date
    04-23-2021
    Location
    United States
    MS-Off Ver
    Office 365 Pro Plus
    Posts
    7

    Re: formula that will calculate a metric (on time delivery) with criteria

    Yes the 75% is calculated by 3 rows out of 4 rows.

    The 3 rows are rows 3, 4, and 5.

    The 3 rows are validated by being within the last 30 days of cell E1, being greater than 5 or less than -2.

    The 4 rows are validated by being with the last 30 days of cell E1.

    The last month is cell E1 or 30-Apr. This could change I just need to be able to lookup data for a specific month of the year. Jan-Feb-March-etc.

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: formula that will calculate a metric (on time delivery) with criteria

    To count # dates within last 30 days:
    COUNTIFS($C$2:$C$6,">="&$E$1-30)
    return 3 (Not 4, row 1 (9-Mar) and 6 (14-Feb) are out of last 30 days)

    To count # dates within last 30 days, and >5 or <-2:
    SUMPRODUCT(($C$2:$C$6>=$E$1-30)*(($B$2:$B$6>5)+($B$2:$B$6<-2)))

    to do average:

    =SUMPRODUCT(($C$2:$C$6>=$E$1-30)*(($B$2:$B$6>5)+($B$2:$B$6<-2)))/COUNTIFS($C$2:$C$6,">="&$E$1-30)

    = 100%

    Is it are you looking for?

  8. #8
    Registered User
    Join Date
    04-23-2021
    Location
    United States
    MS-Off Ver
    Office 365 Pro Plus
    Posts
    7

    Re: formula that will calculate a metric (on time delivery) with criteria

    Bebo,

    That works excellent! Thank you so much. I am going to try and apply it to the actual document and will follow back up.

  9. #9
    Registered User
    Join Date
    04-23-2021
    Location
    United States
    MS-Off Ver
    Office 365 Pro Plus
    Posts
    7

    Re: formula that will calculate a metric (on time delivery) with criteria

    Bebo,

    When I applied it to the larger spreadsheet I would like 1 more change.

    When the date section is used its greater than or equal to the date entered - 30. Is there anyway to make it only look at dates from April or June? Or have it look at the date entered -30 but not more than +30?

    In the below images using a date of 4/1/21 would allow me to lookup data for March. Since the formula is open-ended (greater than or equal to) it also adds in the April data. I would like the OTD to be 0% since there was 1 delivery in March and it was late.

    12.JPG

    1212.JPG
    Last edited by excellerator02; 04-29-2021 at 10:51 AM.

  10. #10
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: formula that will calculate a metric (on time delivery) with criteria

    Try again with new criteria for upper limitation:
    =SUMPRODUCT(($C$2:$C$6>=$E$1-30)*($C$2:$C$6<=$E$1)*(($B$2:$B$6>5)+($B$2:$B$6<-2)))/COUNTIFS($C$2:$C$6,">="&$E$1-30,$C$2:$C$6,"<="&$E$1)

  11. #11
    Registered User
    Join Date
    04-23-2021
    Location
    United States
    MS-Off Ver
    Office 365 Pro Plus
    Posts
    7

    Re: formula that will calculate a metric (on time delivery) with criteria

    Bebo,

    If I could I would give you double rep I would. Thanks so much for coming back and helping me out!

+ 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] Aggregating duplicate values within a SUMIFS or COUNTIFS formula
    By lukethomas in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-09-2020, 03:56 PM
  2. Speed up/Streamline countifs/sumifs code/formula
    By nickytraps in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2018, 05:16 PM
  3. Replies: 6
    Last Post: 10-11-2017, 04:57 PM
  4. [SOLVED] Sumifs/Countifs formula for data table?
    By manny88 in forum Excel General
    Replies: 10
    Last Post: 01-14-2017, 03:34 PM
  5. Making CountIFS and SUMIFS Formula Dynamic
    By HangMan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-30-2015, 04:58 AM
  6. Formula help - COUNTifs, or SUMifs or?
    By jomu84sa in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-16-2014, 05:27 AM
  7. [SOLVED] COUNTIFS and SUMIFS formula help
    By jmcole in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-05-2014, 07:56 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