jardenp
Active Member
- Joined
- May 12, 2009
- Messages
- 373
- Office Version
- 2019
- 2016
- 2013
- 2011
- 2010
- Platform
- Windows
In column B, I want each cell to contain a formula that is dependent on two cells from column A: the cell in the same row and the previous value above that cell. The problem is that sometimes the previous value above is one row above, sometimes two rows, three rows, etc. with blank spaces in between. I can do an elaborate IF function with 20 nested levels or so, but there must be a more elegant solution to this.
(the HTML tool linked in the FAQ was unavailable, so forgive the crude cut and paste)
The results would be like this:
<table style="border-collapse: collapse; width: 251pt;" border="0" cellpadding="0" cellspacing="0" width="334"><col style="width: 48pt;" span="4" width="64"> <col style="width: 59pt;" width="78"> <tbody><tr style="height: 15pt;" height="20"> <td style="height: 15pt; width: 48pt;" height="20" width="64">
</td> <td style="width: 48pt;" width="64">
</td> <td class="xl65" style="width: 48pt;" width="64">A</td> <td style="width: 48pt;" width="64">
</td> <td class="xl65" style="width: 59pt;" width="78">B</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">1</td> <td>
</td> <td align="right">23</td> <td>
</td> <td class="xl66">
</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">2</td> <td>
</td> <td align="right">56</td> <td>
</td> <td class="xl66">=56+23</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">3</td> <td>
</td> <td>
</td> <td>
</td> <td class="xl66">
</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">4</td> <td>
</td> <td align="right">42</td> <td>
</td> <td class="xl66">=42+56</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">5</td> <td>
</td> <td>
</td> <td>
</td> <td class="xl66">
</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">6</td> <td>
</td> <td>
</td> <td>
</td> <td class="xl66">
</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">7</td> <td>
</td> <td align="right">56</td> <td>
</td> <td class="xl66">=56+42</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">8</td> <td>
</td> <td align="right">12</td> <td>
</td> <td class="xl66">=12+56</td> </tr> </tbody></table>
I would use an IF function that depended on a positive value in the adjacent cell in column A, with FALSE returns displaying blank.
Using Excel 2007.
Help Please! Thanks.
(the HTML tool linked in the FAQ was unavailable, so forgive the crude cut and paste)
The results would be like this:
<table style="border-collapse: collapse; width: 251pt;" border="0" cellpadding="0" cellspacing="0" width="334"><col style="width: 48pt;" span="4" width="64"> <col style="width: 59pt;" width="78"> <tbody><tr style="height: 15pt;" height="20"> <td style="height: 15pt; width: 48pt;" height="20" width="64">
</td> <td style="width: 48pt;" width="64">
</td> <td class="xl65" style="width: 48pt;" width="64">A</td> <td style="width: 48pt;" width="64">
</td> <td class="xl65" style="width: 59pt;" width="78">B</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">1</td> <td>
</td> <td align="right">23</td> <td>
</td> <td class="xl66">
</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">2</td> <td>
</td> <td align="right">56</td> <td>
</td> <td class="xl66">=56+23</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">3</td> <td>
</td> <td>
</td> <td>
</td> <td class="xl66">
</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">4</td> <td>
</td> <td align="right">42</td> <td>
</td> <td class="xl66">=42+56</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">5</td> <td>
</td> <td>
</td> <td>
</td> <td class="xl66">
</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">6</td> <td>
</td> <td>
</td> <td>
</td> <td class="xl66">
</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">7</td> <td>
</td> <td align="right">56</td> <td>
</td> <td class="xl66">=56+42</td> </tr> <tr style="height: 15pt;" height="20"> <td style="height: 15pt;" align="right" height="20">8</td> <td>
</td> <td align="right">12</td> <td>
</td> <td class="xl66">=12+56</td> </tr> </tbody></table>
I would use an IF function that depended on a positive value in the adjacent cell in column A, with FALSE returns displaying blank.
Using Excel 2007.
Help Please! Thanks.