+ Reply to Thread
Results 1 to 16 of 16

Alternative to array formula

  1. #1
    Registered User
    Join Date
    01-19-2009
    Location
    earth
    MS-Off Ver
    2013
    Posts
    19

    Alternative to array formula

    Hello all,

    I'm hoping someone here has a creative solution to my (latest) problem.

    On tab #1 I have roughly 600k lines data in a table set up like:

    Project-----Sample-----Status----Status------Person----Employee Type----Timestamp

    A1B1-ABC---A1B1-012---2----------Completed----John Doe--Sales--------------6/24/2013

    On tab two (among other things) i have a table with each "Person"s name and how many "Completed" statuses they have for each Project. I also have a column for the number of days it took to get that many "Completed" and then i solve for average completed per day. Getting the number of completed is fine with multiple Countifs formulas. The problem is the (array) formula to count the number of days they worked on a project.

    Currently that formula reads:
    {=IF(SUM(IF(FREQUENCY(IF(Data![STATUS]="Completed",IF(Data![Project]="A1B1-ABC",IF(Data![Person]="John Doe",Data![TimeStamp]))),Data![TimeStamp]),1))>$E$2,$E$2,(SUM(IF(FREQUENCY(IF(Data![STATUS]="Completed",IF(Data![Project]="A1B1-ABC",IF(Data![Person}="John Doe",Data![TimeStamp]))),Data![TimeStamp]),1)))}

    Where each referenced " " is actually a cell reference and "$E$2" is the cell reference for the maximum number of days for the project.

    Basically i'm asking excel to crawl through all 600k lines for Completed, Project, Person and Timestamp, with a condition for the first three. This works, but is INCREDIBLY slow. Am I missing a better way of accomplishing this that doesnt require the array?

    Thoughts? Thanks!
    Last edited by dmschave; 03-23-2015 at 12:21 PM.

  2. #2
    Forum Contributor
    Join Date
    06-21-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    191

    Re: Alternative to array formula

    Can you post a small sanitized sample of data?

  3. #3
    Registered User
    Join Date
    02-05-2015
    Location
    Edmonton, Alberta
    MS-Off Ver
    2013
    Posts
    70

    Re: Alternative to array formula

    have you tried a sumproduct. it might be a bit quicker

    Sumproduct.xlsx


    the yellow boxes represent the filters you want. and the green box is where the formula is it might give you a good start. if you want a solution on your spreadsheet send a small sample and i can make it easily

  4. #4
    Registered User
    Join Date
    01-19-2009
    Location
    earth
    MS-Off Ver
    2013
    Posts
    19

    Re: Alternative to array formula

    Thanks guys,

    Sorry for the slow reply ... I accidentally hit enter on the wrong cell yesterday and my PC spent the rest of the day running the formula on all of the cells.

    I think a SUMPRODUCT may work, but I don't have a ton of experience using that function and wasn't able to get it working when i tried.

    I've attached a sample workbook. The green column on the Analysis tab has the formula in question.

    Test.xlsx

  5. #5
    Registered User
    Join Date
    02-05-2015
    Location
    Edmonton, Alberta
    MS-Off Ver
    2013
    Posts
    70

    Re: Alternative to array formula

    try this it is a way simpler than a sumproduct but will work the same it finds the first and last time stamp for each worker. this will only work if you sort the data by date




    i put it into the work book for you as well.


    If this works let me know.. this one took a long time to figure out

    EDIT: This isnt what you asked for i am working on that right now
    Last edited by daveisalwayshere; 03-24-2015 at 01:48 PM.

  6. #6
    Registered User
    Join Date
    02-05-2015
    Location
    Edmonton, Alberta
    MS-Off Ver
    2013
    Posts
    70

    Re: Alternative to array formula

    This would work for you I went to your data sheet and added "helper Rows" to pull data this way you can just use a max - min formula to get your results. I transposed your analysis table to make it able to drag the formula across if you have lots of workers.

    Test-1.xlsx


    let me know if this is what you are looking for

  7. #7
    Registered User
    Join Date
    01-19-2009
    Location
    earth
    MS-Off Ver
    2013
    Posts
    19

    Re: Alternative to array formula

    I like the concept you went with there. Not sure it is working the way i expect however. The "total days" would be the number of days where completed is >1. Not the number of days between the first day they had a unit complete and the last day. This is because the person in question might work on project A on Monday, and project B on Tuesday (etc). Where the analysis page would only want to know how many days were spent working on A.

    Adrian, for example, only worked on A1B1 for two days (the 19th and the 23rd).

    Modifying your concept, however, seems to work. If we use =COUNTIFS(PROJECT[RANGE],Project, PERSON[RANGE], Person, TIMESTAMP[RANGE],TIMESTAMP[RANGE]) , i get the expected value of "2" for "Adrian".

    It also doesnt require the J through O columns you added in the Data tab. I'll try it on the actual and report back in a bit. Thanks, hopefully the idea works on the full data!

  8. #8
    Registered User
    Join Date
    01-19-2009
    Location
    earth
    MS-Off Ver
    2013
    Posts
    19

    Re: Alternative to array formula

    For some reason it isnt working in the real data. Using the TIMESTAMP(RANGE) as both the Range and the Condition results in an incorrect count of days. It appears, in this case, to just be counting the number of times one of the days appears in the data where the Person and Project conditions are met.

    I've tried adding a frequency check to the data but this just results in the horribly long processing time and a value of zero. There has to be a solution I'm not thinking of that just returns the total number of days a project has data and meets the person/project conditions.

  9. #9
    Registered User
    Join Date
    02-05-2015
    Location
    Edmonton, Alberta
    MS-Off Ver
    2013
    Posts
    70

    Re: Alternative to array formula

    that is one of the issues with your data you dont have a start and an end to the work what i see is for every timestamp you have that is one days work? is that not the case?

  10. #10
    Registered User
    Join Date
    01-19-2009
    Location
    earth
    MS-Off Ver
    2013
    Posts
    19

    Re: Alternative to array formula

    Correct, I wouldnt have a start and an end date/time. This is just a record of a unit of work being completed, so what i have is a list of how many items were completed each day, what type (project) and by whom.

    So in my 700k +/- records, there are about 30 separate projects and around 70 people. I'm trying to determine the average number of units completed on a project each day worked, by person. Since the staff can work on other projects, I'm only looking for days where they completed at least one unit. So on a project, person A may have worked 20 days and completed 200 units, where person B worked 10 days and completed 100 (each completing 10/day in this case).

  11. #11
    Registered User
    Join Date
    02-05-2015
    Location
    Edmonton, Alberta
    MS-Off Ver
    2013
    Posts
    70

    Re: Alternative to array formula

    Test-1.xlsxis there an in progress status? that would allow you to count the days worked on? i made an adjustment to see if that worked

  12. #12
    Registered User
    Join Date
    02-05-2015
    Location
    Edmonton, Alberta
    MS-Off Ver
    2013
    Posts
    70

    Re: Alternative to array formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    ok so this one should then count the number of "completed projects by a person filtered by the project name

  13. #13
    Registered User
    Join Date
    02-05-2015
    Location
    Edmonton, Alberta
    MS-Off Ver
    2013
    Posts
    70

    Re: Alternative to array formula

    Test-1.xlsx

    here is what i think should be it. I added more criteria to make it look for only the days within the date range

  14. #14
    Registered User
    Join Date
    01-19-2009
    Location
    earth
    MS-Off Ver
    2013
    Posts
    19

    Re: Alternative to array formula

    I'm not getting the expected result for some reason. Odd, as this looks really close. According to the data, Adrian should have "2" days, but the formula is returning "3". The Data:

    Project Sample Status Completed Person Type Timestamp
    A1B1-ABC A1B1-001 2 Completed Adrian Auto 6/19/2013
    A1B1-ABC A1B1-007 2 Completed Adrian Auto 6/19/2013

    A1B1-ABC A1B1-013 2 Completed Adrian Auto 6/23/2013
    B1B2-BCD B1B2-002 2 Completed Adrian Auto 6/24/2013

    So Adrian only worked the 19th and 23rd on A1B1-ABC ... which should result in a "2". I'll play around with it and figure out what the third result is coming from.

    Edit- Confirmed that it is counting each instance of "Adrian" where the Project and other variables are met... so in this case it counts the 6/19/13 day twice. Working on a fix

    Thanks!
    Last edited by dmschave; 03-25-2015 at 12:08 PM.

  15. #15
    Registered User
    Join Date
    01-19-2009
    Location
    earth
    MS-Off Ver
    2013
    Posts
    19

    Re: Alternative to array formula

    Ok. I tried to start with a fresh approach using the DCOUNTA function, but get the same error with the formula counting EACH date that meets the other criteria, not the instances of a unique date. I'm completely confused as I thought counting unique was the entire purpose of the function.

    Workbook attached. New formula is on the Data tab in Q2.

    I highlighted each day a different color and turned all instances that dont meet the criteria red text to make it easy to spot the expected result. So in the test case, again, "2". One green (19th) and one yellow (23rd) for Adrian. Its counting both instances of the 19th, however.

    Test-1-3.xlsx

  16. #16
    Registered User
    Join Date
    01-19-2009
    Location
    earth
    MS-Off Ver
    2013
    Posts
    19

    Re: Alternative to array formula

    Bump looking for help. I feel like we're pretty close, but my alternate attempts havent led to anything

+ 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. Alternative to using an array formula for {=LARGE(IF(... function
    By Rabiah in forum Excel Formulas & Functions
    Replies: 28
    Last Post: 05-30-2014, 05:52 AM
  2. [SOLVED] Array formula too slow. Need an alternative..
    By cool_anu4u in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-28-2013, 04:56 AM
  3. Alternative to an array formula.
    By RunHard in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-16-2009, 09:18 AM
  4. Array Formula Alternative
    By smninos in forum Excel General
    Replies: 10
    Last Post: 07-15-2009, 04:31 PM
  5. Replies: 4
    Last Post: 01-05-2009, 10:59 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