Consulting

Results 1 to 3 of 3

Thread: Komplex If-Loop

  1. #1
    VBAX Regular
    Joined
    Jan 2017
    Location
    Warsaw
    Posts
    70
    Location

    Komplex If-Loop

    Hey guys!


    I am currently facing a somewhat more complex task and ask for your support

    I have data sets in the following structure:
    These expand every week. The columns are always the same, but newer data appears for each name.

    Unbenannt.jpg
    I have a second table where I have the names 1 time each (1st column).

    Unbenannt.PNG
    In the third column, I write a date.
    Now I have to somehow implement the following logic:
    The goal is to get a "Go" or "Exit" in column "B" to the respective name.

    If the selected date is less than the maximum of the record column "C", then write "Exit" in column "F". However, the maximum date only applies to the values with the status 1 (column "B").
    However, only write "Exit" if the sum of the values for Status 1 (Data set - column "D") is greater than 20.
    If the data is now expanding and the last date from the data set is greater than the one selected, "Exit" should continue to appear as long as the sum of state 1 is not greater than 30.
    Then again from 30> Exit and rolling in 10 steps again.

    Do you have an idea for that?
    Is this possible without auxiliary columns?
    Maybe its a new VBA function?




    I am thankful for any advice!


    Best regards
    Josh
    Attached Images Attached Images

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Is this the algorithm you want
    For each Set of Names in Table1
    For each Subset with 1 in Column B
    If Sum of Column D of Subset = (10 + 10n) Then 'Where n >= 1
    If SelectDate < Max(Column C Of Subset) Then
    Table 2 Column B = "Exit"
    Else Table 2 Column B = "Go"
    If the data is now expanding and the last date from the data set is greater than the one selected, "Exit" should continue to appear as long as the sum of state 1 is not greater than 30.
    Then again from 30> Exit and rolling in 10 steps again.
    I tried to incorporate that, but I don't truly understand it.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Regular
    Joined
    Jan 2017
    Location
    Warsaw
    Posts
    70
    Location
    Hey! Thanks for your approach und reply!
    I'm sorry for my bad English, I'll try again.


    If I get a new record next week, the person or name may have new data.
    If this data or the maximum day / date is greater than my selected date, Exit should not appear until the sum of D is greater than 30. So Exit once the limit has been exceeded and if new records come then again when the new level (10+) was reached.


    I hope this is understandlicger, otherwise likes to let you know

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •