#### MisterProzilla

##### Active Member

- Joined
- Nov 12, 2015

- Messages
- 263

Hi there,

I have a column which holds a running total of hours taken. So, for example, the user enters a number of hours in cell L50, then the formula below, which sits in N50, deducts that number from a running total above in column N.

=IF(L50<>"",IF(SUM($N$27:$N49)>0,

The issue is that this formula was built on the assumption that hours taken would always be positive numbers and therefore the figure would always be reducing. The problem is that I sometimes need to enter negative figures to balance things out, and so the

So, for example, with 50 hours remaining, I enter -5 in column L to add a few hours back on, taking it to 55. I then enter -10 in the cell below, but it now picks the original 50 up as the smallest figure in the above range, resulting in 60 where it should be 65.

I hope this makes sense. Basically, I need to replace the SMALL component with something that finds the lowest (position, not value) non-blank cell in the range $N$27:$N49. I can't use the most recent, as not all values have dates attached.

Thanks in advance for your help

I have a column which holds a running total of hours taken. So, for example, the user enters a number of hours in cell L50, then the formula below, which sits in N50, deducts that number from a running total above in column N.

=IF(L50<>"",IF(SUM($N$27:$N49)>0,

**SMALL($N$27:$N49,1)**-IF($M50<>"",$M50,0),$F$22-M50),"")The issue is that this formula was built on the assumption that hours taken would always be positive numbers and therefore the figure would always be reducing. The problem is that I sometimes need to enter negative figures to balance things out, and so the

**SMALL**part of the formula below is causing problems, as it's looking for the smallest figure in the cells above it, whereas I need it to find the bottom-most non-blank value.So, for example, with 50 hours remaining, I enter -5 in column L to add a few hours back on, taking it to 55. I then enter -10 in the cell below, but it now picks the original 50 up as the smallest figure in the above range, resulting in 60 where it should be 65.

I hope this makes sense. Basically, I need to replace the SMALL component with something that finds the lowest (position, not value) non-blank cell in the range $N$27:$N49. I can't use the most recent, as not all values have dates attached.

Thanks in advance for your help

Last edited: