Dear friends,
I'm trying to resolve the following problem in my excel worksheet. Any help would be greatly appreciated.
I have the following numbers in column A (range is A1:A11):
<table width="64" border="0" cellpadding="0" cellspacing="0"><tbody><tr style="height: 15pt;" height="20"><td style="height: 15pt; width: 48pt;" width="64" align="right" height="20">10</td> </tr> <tr style="height: 15.75pt;" height="21"> <td style="height: 15.75pt;" align="right" height="21">11</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">12</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">11</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">13</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">13</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">13</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">12</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">12</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">10</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">11</td> </tr> </tbody></table>
I need to enter the following conditions in column B (Range B1:B11):
Starting at current cell:
1. If the value of the cell above is lower than current cell enter 1 in column B.
2. If cell above is greater than current cell, enter -1.
3. This is the tricky part. If cell above equals to current cell, go and check until you find a cell above that is not equal to current cell and then repeat 1 and 2.
The end result looks like this:
<table width="128" border="0" cellpadding="0" cellspacing="0"><col style="width: 48pt;" width="64" span="2"> <tbody><tr style="height: 15pt;" height="20"> <td style="height: 15pt; width: 48pt;" width="64" align="right" height="20">10</td> <td style="width: 48pt;" width="64">
</td> </tr> <tr style="height: 15.75pt;" height="21"> <td style="height: 15.75pt;" align="right" height="21">11</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">12</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">11</td> <td align="right">-1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">13</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">13</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">13</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">12</td> <td align="right">-1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">12</td> <td align="right">-1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">10</td> <td align="right">-1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">11</td> <td align="right">1</td> </tr> </tbody></table>
I will need to do it for thousands of rows, so using bunch of "IF" statements won't do it.
Thank you,
Jay
I'm trying to resolve the following problem in my excel worksheet. Any help would be greatly appreciated.
I have the following numbers in column A (range is A1:A11):
<table width="64" border="0" cellpadding="0" cellspacing="0"><tbody><tr style="height: 15pt;" height="20"><td style="height: 15pt; width: 48pt;" width="64" align="right" height="20">10</td> </tr> <tr style="height: 15.75pt;" height="21"> <td style="height: 15.75pt;" align="right" height="21">11</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">12</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">11</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">13</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">13</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">13</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">12</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">12</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">10</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">11</td> </tr> </tbody></table>
I need to enter the following conditions in column B (Range B1:B11):
Starting at current cell:
1. If the value of the cell above is lower than current cell enter 1 in column B.
2. If cell above is greater than current cell, enter -1.
3. This is the tricky part. If cell above equals to current cell, go and check until you find a cell above that is not equal to current cell and then repeat 1 and 2.
The end result looks like this:
<table width="128" border="0" cellpadding="0" cellspacing="0"><col style="width: 48pt;" width="64" span="2"> <tbody><tr style="height: 15pt;" height="20"> <td style="height: 15pt; width: 48pt;" width="64" align="right" height="20">10</td> <td style="width: 48pt;" width="64">
</td> </tr> <tr style="height: 15.75pt;" height="21"> <td style="height: 15.75pt;" align="right" height="21">11</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">12</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">11</td> <td align="right">-1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">13</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">13</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">13</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">12</td> <td align="right">-1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">12</td> <td align="right">-1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">10</td> <td align="right">-1</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">11</td> <td align="right">1</td> </tr> </tbody></table>
I will need to do it for thousands of rows, so using bunch of "IF" statements won't do it.
Thank you,
Jay