+ Reply to Thread
Results 1 to 6 of 6

Value from list depending on conditions that should start over once finished

  1. #1
    Registered User
    Join Date
    08-16-2021
    Location
    Manchester, England
    MS-Off Ver
    365
    Posts
    5

    Value from list depending on conditions that should start over once finished

    Hello everyone,

    I need your help.

    I have a table of employees. I want to provide an alternative in case there is a clash with dates or amount of hours worked. I managed to get a formula that goes through my list of employees but it only goes through once. I want it to start over if there is no conflict.

    The formula is for column J. It should work for both teams. I only used Team2 to make it easier to read

    Thank you
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    08-16-2021
    Location
    Manchester, England
    MS-Off Ver
    365
    Posts
    5

    Re: Value from list depending on conditions that should start over once finished

    My apologies. My explanation was not very clear.

    I am looking for a formula for column J. I want 3 possible outcomes:

    "Ok to Allocate" - when the preferred option on Column F is free during the period of time chosen between Column C and Column D for the amount of hours per day needed in Column 3.
    Another person from the list of that team who is free during that period for those hours when the preferred option is not available (this is where a can't manage to get it done properly
    "Contractor" - when nobody on the list is available during that period for those hours per day


    Formulas I am using:

    Column G (Conflict) =if((if(or(F2=0,A2=0),false,sumproduct((A2=$A$2:$A$13)*(F2=$F$2:$F$13))>1))=false,if(AND(SUMPRODUCT(($C2<=$D$2:$D$13)*($D2>=$C$2:$C$13)*($F2=$F$2:$F$13)*($B2=$B$2:$B$13))>=1,sum(if(H2>1,FILTER($E$2:$E$13,F2=$F$2:$F$13,H2=$H$2:$H$13),E2))>8),true,false),true)

    Column H (Number of conflicts per person per period of time) =SUMPRODUCT(($C2<=$D:$D)*($D2>=$C:$C)*($F2=$F:$F))

    Column I (Available hours per day for person chosen) =8-sum(if(H2>1,FILTER($E$2:$E$36,F2=$F$2:$F$36,H2=$H$2:$H$36),E2))

    Column J (Alternative) =ArrayFormula(if($A2<>0, if($F2<>0,(IF($G2=False,"Ok to Allocate",if(INDEX(INDEX($A$16:$B$21,0,MATCH($B2,$A$15:$B$15,0)),SMALL(IF(ISNA(MATCH(INDEX($A$16:$B$21,0,MATCH($B2,$A$15:$B$15,0)),$F$2:$F$13,0)),ROW(INDEX($A$16:$B$21,0,MATCH($B2,$A$15:$B$15,0)))-ROW($A$16)+1),COUNTIFS($B$2:$B2,$B2,$G$2:$G2,$G2)))="","Contractor",INDEX(INDEX($A$16:$B$21,0,MATCH($B2,$A$15:$B$15,0)),SMALL(IF(ISNA(MATCH(INDEX($A$16:$B$21,0,MATCH($B2,$A$15:$B$15,0)),$F$2:$F$13,0)),ROW(INDEX($A$16:$B$21,0,MATCH($B2,$A$15:$B$15,0)))-ROW($A$16)+1),COUNTIFS($B$2:$B2,$B2,$G$2:$G2,$G2)))))),""),"No Project selected"))

    Cell J11 results in "Contractor". I was expecting to say "Mary" as she is someone from the team needed that would be free during that period of time for the amount of hours needed

  3. #3
    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,719

    Re: Value from list depending on conditions that should start over once finished

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. As you are new, I will do it for you today: https://www.excelguru.ca/forums/show...-once-finished.)
    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.

  4. #4
    Registered User
    Join Date
    08-16-2021
    Location
    Manchester, England
    MS-Off Ver
    365
    Posts
    5

    Re: Value from list depending on conditions that should start over once finished

    Hi Ali,

    Sorry about this. I created the other post because I haven't received any replies on this forum. I tried to share the link but I get this message:

    Errors
    The following errors occurred with your submission
    You are not allowed to post any kinds of links, images or videos until you post a few times.

    It's post on mrexcel and reddit as well

  5. #5
    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,719

    Re: Value from list depending on conditions that should start over once finished

    Please post the URLs to the posts on Mr Excel and Reddit - you can post them with a couple of gaps in them.

  6. #6
    Registered User
    Join Date
    08-16-2021
    Location
    Manchester, England
    MS-Off Ver
    365
    Posts
    5

    Re: Value from list depending on conditions that should start over once finished

    htt ps: //ww w.red dit.co m/r/excel/comments/p6mxsa/value_from_list_depending_on_conditions_that/
    htt ps: //ww w.mrex cel.co m/board/thread...ished.1179422/

+ 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. Get a sum for a range of value depending on start&end criteria cells
    By excelsorusor in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-16-2018, 04:56 PM
  2. [SOLVED] Working Out Average Depending on Start Date
    By jonodillieono in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-07-2016, 01:14 PM
  3. Calculating Amounts per month depending on Start Dates
    By cuadra in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-26-2013, 06:10 PM
  4. [SOLVED] Have to calculate a price depending on the start and end date.
    By Misas in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-29-2012, 10:35 AM
  5. Start automatically a mcro depending on the value in the cell
    By tromao in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-15-2007, 12:11 PM
  6. [SOLVED] start a copy of data at a line depending on date
    By news in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-05-2006, 06:55 PM
  7. [SOLVED] copying names to list depending on certain conditions
    By macca in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-21-2005, 07:05 AM

Tags for this Thread

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