Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
I have a data set that fluctuates between high and low values. For context, the data set represents the number of wells needed by month. It is a 12x1 vector (see attached worksheet). I need to program a loop (see my attempt) that can calculate the total number of wells needed when the number of wells increases. For instance, if in month 1, I have 10 wells and month 2 has 9 wells, I still need a total of ten wells. However, if in month 3, I need 12 wells, then I need 2 additional wells, for a total of 12 wells. I need to graph the number of wells needed over time, so it would be helpful to not have any zeros in my vector, and rather maintain the same value until the value increases. Also, if I reach the maximum number of wells, I need to be able to reflect this in the vector for the rest of the year (i.e. (10,9,12,12,12,12,12.etc.).
Solved! Go to Solution.
Anne Maurer wrote:
I have a data set that fluctuates between high and low values. For context, the data set represents the number of wells needed by month. It is a 12x1 vector (see attached worksheet). I need to program a loop (see my attempt) that can calculate the total number of wells needed when the number of wells increases. For instance, if in month 1, I have 10 wells and month 2 has 9 wells, I still need a total of ten wells. However, if in month 3, I need 12 wells, then I need 2 additional wells, for a total of 12 wells. I need to graph the number of wells needed over time, so it would be helpful to not have any zeros in my vector, and rather maintain the same value until the value increases. Also, if I reach the maximum number of wells, I need to be able to reflect this in the vector for the rest of the year (i.e. (10,9,12,12,12,12,12.etc.).A
Anne,
I'm afraid I don't have a version of Mathcad that will read an xmcd file, but I'm guessing that the attached M11 worksheet might do what you want?
Stuart
f.kohlhepp wrote:
In one line
Two! You had to define the range variable.
Neat trick by Fred though.
Mike
Mike Armstrong wrote:
Neat trick by Fred though.
That it was.
My churlish and jealous nature means he'll never hear that from me, though.
Besides, he's a colonial and praise will only lead to his getting ideas above his station.
My churlish and jealous nature means he'll never hear that from me, though.
Come on..... I've seen you heap out praise before.... Haven't I????
Mike