There are two parts to the problem. The first one is the "Result1" column. Based on the information from columns "Code," "Date," and "Cycle," and for each value of the column "Code" characterize the variation within cycles. So every time a new "PD" or "HD" cycle starts, the first month will be counted as one, and it will go to the last month within the same cycle to identify the difference. Based on that, it will rename the rows under Result1 "WI" if there are within the first three months of the cycle, and "WO" if there are the last three ones. Anything in between will be renamed as "Valid." But this will only happen if there are at least seven months of difference between the cycle (for that specific "Code"), AND at least one row can be classified as "WI" (first 3 months), one as only "WO" (last 3 months), and if there is one that can be classified as "Valid" (neither the first 3 months, nor the last 3 months within the cycle) . If that condition is not met, then Result1 can be labeled as "N/A". The second part, Result2, is to identify those cycle switches from "HD" to " PD" and "PD" to HD" that occur for each value of the column "Code". Also, identify if it is the first time, the second time, ...., that the switch occurs within that "Code." Thank you for your help, and please let me know if this answer clarifies your question.
... View more
Hi, I need help scripting some conditions. I am attaching a sample data set and a word document with the conditions. I am able to do simple scripts but this one goes beyond my level of expertise 🙂 Thank you.
... View more