+ Reply to Thread
Results 1 to 13 of 13

Array Question

  1. #1
    Registered User
    Join Date
    04-15-2013
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    80

    Array Question

    This is embarrassing to ask, but I can't get a formula to work. I have Column A w/ a set of dates. Column B is another set of dates, all greater than their counterparts in Column A. Some dates in B are blank (process not finished). How do I get an average time of completion e.g. average between B-A)

    Added attachment.

    Thanks,

    Vitaly
    Attached Files Attached Files
    Last edited by vichisov; 10-16-2017 at 05:46 PM. Reason: New File.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2016 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    30,525

    Re: Array Question

    And what exactly is the formula??? How are we supposed to help you to troubleshoot it without knowing what you have tried?

    Will you please attach a sample Excel workbook?

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  3. #3
    Registered User
    Join Date
    04-15-2013
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    80

    Re: Array Question

    Still working on this problem. Would appreciate any help people can offer.

  4. #4
    Forum Expert sandy666's Avatar
    Join Date
    02-05-2015
    Location
    Any Country
    MS-Off Ver
    farerwell
    Posts
    8,749

    Re: Array Question

    Maybe =AVERAGE(B1:B26-A1:A26) with Control+Shift+Enter
    sandy
    How to create an editor for Power Query with Notepad++ (tutorial)
    How to create timeline project with vertical today marker (2010, 2013, 2016 etc...) (examples)
    Tips for Excellent Spreadsheets

    What makes learning so hard is the amount of knowledge you have to unlearn
    Why is my program not doing what I expect?
    Because you set the wrong expectations. Rewire your brain

  5. #5
    Registered User
    Join Date
    04-15-2013
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    80

    Re: Array Question

    Doesn't look like it. At least one issue is the blank cells throwing the formula off with a default value of 0.

  6. #6
    Forum Expert sandy666's Avatar
    Join Date
    02-05-2015
    Location
    Any Country
    MS-Off Ver
    farerwell
    Posts
    8,749

    Re: Array Question

    What about ColA if ColB is blank? ( 0 )

    formula above is single result formula not for dragging down

    you can try:
    =AVERAGEIF(B1:B26,"<>""",B1:B26)-AVERAGE(A1:A26)

    but with your description I don't know what you want to achieve.
    Your example file should contain BEFORE and AFTER (result)

    Quote Originally Posted by AliGW View Post
    2. Make sure that your desired solution is also shown (mock up the results manually).
    Last edited by sandy666; 10-16-2017 at 05:32 PM.

  7. #7
    Registered User
    Join Date
    04-15-2013
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    80

    Re: Array Question

    {=Avergae(B:B-A:A)} gives me a neggative number. Same as making Column C where C1=(B1-A1) etc and then averaging that number. The blank cells are all -429##, thus throwing everything off.

  8. #8
    Forum Expert sandy666's Avatar
    Join Date
    02-05-2015
    Location
    Any Country
    MS-Off Ver
    farerwell
    Posts
    8,749

    Re: Array Question

    Re-read post#2 point 2
    &
    re-read post #6
    Last edited by sandy666; 10-16-2017 at 05:35 PM.

  9. #9
    Registered User
    Join Date
    04-15-2013
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    80

    Re: Array Question

    Reposted attachment. Couldn't get #6 to work.

  10. #10
    Forum Expert sandy666's Avatar
    Join Date
    02-05-2015
    Location
    Any Country
    MS-Off Ver
    farerwell
    Posts
    8,749

    Re: Array Question

    try this one:

    =SUMPRODUCT((B1:B26<>"")*(B1:B26-A1:A26))/COUNT(B1:B26)

    and probably you will need change cell format to general or number.


    If that takes care of your original question, & to say Thanks, please click on Add Reputtion (bottom left corner of the post of the person(s) who helped you)
    then select Thread Tools from the menu (top right corner of your thread) and mark this thread as SOLVED.
    If you did it - ignore it.
    Thank you.
    Attached Files Attached Files
    Last edited by sandy666; 10-16-2017 at 07:14 PM.

  11. #11
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    '97, 2016
    Posts
    2,523

    Re: Array Question

    Or:
    Please Login or Register  to view this content.
    Clicking the Add Reputation star below any helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion. (Thread Tools above Post # 1) Thanks!-Lee

  12. #12
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,817

    Re: Array Question

    It is quite possible that blanks can be in both, A and B columns. Therefor I would suggest an array formula

    ***Array formula
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.
    You will know the array is active when you see curly braces { } appear around your formula.
    If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  13. #13
    Registered User
    Join Date
    04-15-2013
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    80

    Re: Array Question

    Awesome. Both solutions above work perfectly. Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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