+ Reply to Thread
Results 1 to 14 of 14

On-Time Completion Formula | Offset Dynamic Named Ranges in MM/DD/YYYY Format

Hybrid View

  1. #1
    Registered User
    Join Date
    10-14-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    47

    On-Time Completion Formula | Offset Dynamic Named Ranges in MM/DD/YYYY Format

    Column A:A and B:B consist of dates (mm/dd/yyyy) and are both dynamic offset named ranges. Column A:A is the "Planned End Date" and column B:B is the "Actual End Date". I want to count the number of instances where the date in B:B is greater than the date in A:A on the same row, then divide by the total number of rows consisting of a date in column B:B. I write Array functions from my data set because it is in SQL table format residing in Excel, and since my End Users submit new row data on a daily basis using a VB data entry UserForm, the named ranges of each column must be dynamic, thus I offset them to grow with each additional. row of data added.

    The output I'm looking for will be a percentage yield.

    Any help is greatly appreciated.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: On-Time Completion Formula | Offset Dynamic Named Ranges in MM/DD/YYYY Format

    Try

    =SUMPRODUCT(--(B1:B1000>A1:A1000))/COUNT(B1:B1000)

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: On-Time Completion Formula | Offset Dynamic Named Ranges in MM/DD/YYYY Format

    I think this is 1 of those times when a sample workbook will get you better help
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: On-Time Completion Formula | Offset Dynamic Named Ranges in MM/DD/YYYY Format

    Good 1 Jonmo, on reading again, I saw the "count the number of instances" bit. I was reading way more into it than was needed

  5. #5
    Registered User
    Join Date
    10-14-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: On-Time Completion Formula | Offset Dynamic Named Ranges in MM/DD/YYYY Format

    I've included a sample workbook. Note that I've also offset the named ranges of column A:A and B:B so they are dynamic and can potentially grow as more rows of data are added. The sample data set exists in the first sheet, 'Raw Data', and the desired output is in sheet2, 'Output'.

    The formula should equal 25% if done correctly. So it counts the total number of [Actual End Date] that are "<=" [Planned End Date], then divides by the total number of rows in the data set.

    THANK YOU TREMENDOUSLY!

    Sample Workbook.xlsx

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: On-Time Completion Formula | Offset Dynamic Named Ranges in MM/DD/YYYY Format

    Just take the formula I posted and replace the ranges with your respective 'Named Ranges'
    Also need to change the > to <=
    Your Original Post said count if B is > A
    But your last post changed to count if B <= A

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: On-Time Completion Formula | Offset Dynamic Named Ranges in MM/DD/YYYY Format

    THis works...
    =SUMPRODUCT(--(B2:B5<A2:A5))/COUNT(B2:B5)

    (thanks to Jonmo)

  8. #8
    Registered User
    Join Date
    10-14-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: On-Time Completion Formula | Offset Dynamic Named Ranges in MM/DD/YYYY Format

    That's the ticket! You nailed it So grateful!!

  9. #9
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: On-Time Completion Formula | Offset Dynamic Named Ranges in MM/DD/YYYY Format

    You're welcome.

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: On-Time Completion Formula | Offset Dynamic Named Ranges in MM/DD/YYYY Format

    Happy to help, thanks for the rep (Jonmo did the work though)

  11. #11
    Registered User
    Join Date
    10-14-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: On-Time Completion Formula | Offset Dynamic Named Ranges in MM/DD/YYYY Format

    Sample Workbook.xlsx

    Sample workbook above.

    One additional question. Assume that column B:B [Actual End Date] is manually populated. Array formulas can't calculate if the variables are NULL. What if Column A:A [Planned End Date] is populated for three rows (A1:A3), but column B:B [Actual End Date] only has data for rows B1:B2.

    I would still like to produce output for the rows that include data within the same row in both column A:A and B:B.

    This one is a stumper...

  12. #12
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: On-Time Completion Formula | Offset Dynamic Named Ranges in MM/DD/YYYY Format

    You'll need a different method to get your dynamic named ranges.
    Because BOTH ranges MUST be the same dimensions in sumproduct.

    Here it is with hard coded ranges.
    =SUMPRODUCT(--('Raw Data'!B2:B1000<='Raw Data'!A2:A1000),--('Raw Data'!B2:B1000<>""))/COUNT('Raw Data'!B2:B1000)



    To get your named ranges the same dimensions, I'd suggest using the same column for the counta part of both named range formulas.
    Probably column A.
    And I recommend making both named ranges start in row 2 instead of 1 (to exclude the header rows)

  13. #13
    Registered User
    Join Date
    10-14-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: On-Time Completion Formula | Offset Dynamic Named Ranges in MM/DD/YYYY Format

    You nailed it again! Thank you so much!

    I renamed the COUNTA part of my offset named ranges as you instructed and it works great!

  14. #14
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: On-Time Completion Formula | Offset Dynamic Named Ranges in MM/DD/YYYY Format

    You're welcome.

+ 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. Offset and Indirect with Dynamic Named Ranges
    By nickmangan in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-07-2014, 10:42 PM
  2. Dynamic Named Ranges in Formula
    By Newie2014 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-11-2014, 05:16 AM
  3. [SOLVED] Index Match Formula in VBA, that utilises Workbook dynamic named ranges
    By JamieW in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-13-2014, 09:39 AM
  4. Trying to format activecell.offset as date dd/mm/yyyy
    By Raptor6L in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-06-2012, 04:58 PM
  5. Help to adapt Formula syntax to work with Dynamic Named Ranges
    By Sam via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 04-28-2005, 08:06 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